Commit 5cfb3a79 authored by Farkas Ingrid's avatar Farkas Ingrid
Browse files

Added UnusedImportsProject class and dependencies.


Signed-off-by: Farkas Ingrid's avatarFakas Izabella Ingrid <farkas94ingi@gmail.com>
parent ae6eaeee
......@@ -112,6 +112,7 @@ public final class StaticData {
final Map<CodeSmellType, BaseProjectCodeSmellSpotter[]> pm = new HashMap<CodeSmellType, BaseProjectCodeSmellSpotter[]>();
pm.put(CodeSmellType.CIRCULAR_IMPORTATION, new BaseProjectCodeSmellSpotter[] { new CircularImportation() });
pm.put(CodeSmellType.UNUSED_IMPORTS_PROJECT, new BaseProjectCodeSmellSpotter[] { new UnusedImportsProject() });
pm.put(CodeSmellType.LANGUAGE_MIXING, new BaseProjectCodeSmellSpotter[]{ new LanguageMixing() });
return Collections.unmodifiableMap(pm);
......
......@@ -19,6 +19,7 @@ import org.eclipse.titanium.Activator;
public enum CodeSmellType implements ProblemType{
ALTSTEP_COVERAGE("Altstep coverage", 1.0, 5.0, 76.0),
CIRCULAR_IMPORTATION("Circular importation", 2.0, 12.0, 80.0),
UNUSED_IMPORTS_PROJECT("Unused import in project", 0.0, 0.5, 1.0),
LANGUAGE_MIXING("Language mixing", 2.0, 12.0, 80.0),
CONSECUTIVE_ASSIGNMENTS("Consecutive assignments", 0.0, 1.0, 6.0),
CONVERT_TO_ENUM("Convert to enumeration", 0.5, 3.0, 8.0),
......
......@@ -28,6 +28,7 @@ public class RiskFactorCalculator {
TaskType.FIXME,
TaskType.TODO,
CodeSmellType.CIRCULAR_IMPORTATION,
CodeSmellType.UNUSED_IMPORTS_PROJECT,
CodeSmellType.LANGUAGE_MIXING,
CodeSmellType.TOO_MANY_STATEMENTS,
CodeSmellType.TOO_MANY_PARAMETERS,
......
......@@ -26,6 +26,7 @@ import org.eclipse.titanium.markers.types.CodeSmellType;
public enum ProblemTypePreference {
ALTSTEP_COVERAGE("Report insufficient altstep coverage", EnumSet.of(CodeSmellType.ALTSTEP_COVERAGE)),
CIRCULAR_IMPORTATION("Report circular module dependencies", EnumSet.of(CodeSmellType.CIRCULAR_IMPORTATION)),
UNUSED_IMPORTS_PROJECT("Report unused module importation in project", EnumSet.of(CodeSmellType.UNUSED_IMPORTS_PROJECT)),
LANGUAGE_MIXING("Report modules with different language restrictions", EnumSet.of(CodeSmellType.LANGUAGE_MIXING)),
CONSECUTIVE_ASSIGNMENTS("Report consecutive assignments", EnumSet.of(CodeSmellType.CONSECUTIVE_ASSIGNMENTS)),
CONVERT_TO_ENUM("Report usage of non-enumeration types in select statements", EnumSet.of(CodeSmellType.CONVERT_TO_ENUM)),
......
......@@ -80,6 +80,7 @@ public final class MarkersPreferencePage extends FieldEditorPreferencePage imple
+ " it recommendable for an altstep to handle any possible incoming message types");
m.put(ProblemTypePreference.CIRCULAR_IMPORTATION, "Circular importation is not prohibited in TTCN-3,"
+ " but it is also not recommended.");
m.put(ProblemTypePreference.UNUSED_IMPORTS_PROJECT, "popup text");
m.put(ProblemTypePreference.LANGUAGE_MIXING, "Mixing modules with different language versions in the same project "
+ "is a sign of architectural problems as it can lead to missunderstandings/unexpected behaviours/aged design.\n"
+ "it is always recommended to adapt TTCN-3 source code to the newest version of the standard.");
......@@ -215,6 +216,7 @@ public final class MarkersPreferencePage extends FieldEditorPreferencePage imple
comp.setLayout(new FillLayout(SWT.VERTICAL));
createField(comp, ProblemTypePreference.GOTO);
createField(comp, ProblemTypePreference.CIRCULAR_IMPORTATION);
createField(comp, ProblemTypePreference.UNUSED_IMPORTS_PROJECT);
createField(comp, ProblemTypePreference.LANGUAGE_MIXING);
createField(comp, ProblemTypePreference.MISSING_IMPORT);
createField(comp, ProblemTypePreference.UNUSED_IMPORT);
......
......@@ -40,6 +40,7 @@ public class RiskFactorPreferencePage extends PreferencePage implements IWorkben
insertTask(TaskType.FIXME);
insertTask(TaskType.TODO);
insertSP(CodeSmellType.CIRCULAR_IMPORTATION);
insertSP(CodeSmellType.UNUSED_IMPORTS_PROJECT);
insertSP(CodeSmellType.LANGUAGE_MIXING);
insertSP(CodeSmellType.TOO_MANY_STATEMENTS);
insertSP(CodeSmellType.TOO_MANY_PARAMETERS);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment