Commit 0dfd16c7 authored by Gerson Sunyé's avatar Gerson Sunyé
Browse files

Ordered rule calls in alphabetical order to reduce merge conflicts

parent 12a0774e
......@@ -13,7 +13,7 @@ uses bestPractices;
uses documentation;
uses errorProne;
rule Java2SMM {
from
project: java!Model
......@@ -37,46 +37,46 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
-- Multithreading rules
--
thisModule.useNotifyAllInsteadOfNotify(),
thisModule.avoidThreadGroup(),
thisModule.dontCallThreadRun(),
thisModule.useNotifyAllInsteadOfNotify(),
-- Code Style rules
--
thisModule.shortMethodName(),
thisModule.tooManyStaticImports(),
thisModule.shortClassName(),
thisModule.shortVariableName(),
thisModule.extendsObject(),
thisModule.unnecessaryReturn(),
thisModule.longVariable(),
thisModule.noPackageDeclaration(),
thisModule.genericsNaming(),
thisModule.longVariable(),
thisModule.misLeadingVariableName(),
thisModule.noPackageDeclaration(),
thisModule.shortClassName(),
thisModule.shortMethodName(),
thisModule.shortVariableName(),
thisModule.tooManyStaticImports(),
thisModule.unnecessaryReturn(),
-- Design rules
--
thisModule.tooManyFields(),
thisModule.tooManyMethods(),
thisModule.returnFromFinallyBlock(),
thisModule.longInstantiation(),
thisModule.shortInstantiation(),
thisModule.ExcessiveClassLength(),
thisModule.excessiveParameterList(),
thisModule.finalFieldCouldBeStatic(),
thisModule.longInstantiation(),
thisModule.returnFromFinallyBlock(),
thisModule.shortInstantiation(),
thisModule.signatureDeclareThrowsException(),
thisModule.ExcessiveClassLength(),
thisModule.tooManyFields(),
thisModule.tooManyMethods(),
-- Performance rules
--
thisModule.uselessStringValueOf(),
thisModule.tooFewBranchesForASwitchStatement(),
thisModule.useIndexOfChar(),
thisModule.avoidPrintStackTrace(),
thisModule.avoidRethrowingException(),
thisModule.avoidUsingShortType(),
thisModule.emptyStatementBlock(),
thisModule.avoidRethrowingException(),
thisModule.integerInstantiation(),
-- thisModule.stringToString(),
thisModule.useIndexOfChar(),
thisModule.uselessStringValueOf(),
thisModule.tooFewBranchesForASwitchStatement(),
-- Documentation rules
--
......@@ -85,32 +85,30 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
-- Error prone rules
--
thisModule.missingBreakInSwitch(),
thisModule.suspiciousEqualsMethodName(),
thisModule.doNotExtendJavaLangThrowable(),
thisModule.doNotExtendJavaLangError(),
thisModule.avoidCallingFinalize(),
thisModule.emptyTryBlock(),
thisModule.dontImportSun(),
thisModule.emptySwitchStatement(),
thisModule.emptySynchronizedBlock(),
thisModule.UnconditionalIfStatement(),
thisModule.EmptyInitializer(),
thisModule.CloneMethodMustBePublic(),
thisModule.AvoidEnumAsIdentifier(),
thisModule.AvoidCatchingNPE(),
thisModule.UseProperClassLoader(),
thisModule.avoidCatchingThrowable(),
thisModule.AvoidEnumAsIdentifier(),
thisModule.CloneMethodMustBePublic(),
thisModule.doNotCallGarbageCollectionExplicitly(),
thisModule.doNotExtendJavaLangError(),
thisModule.doNotExtendJavaLangThrowable(),
thisModule.dontImportSun(),
thisModule.emptyCatchBlock(),
thisModule.EmptyInitializer(),
thisModule.emptySwitchStatement(),
thisModule.emptySynchronizedBlock(),
thisModule.emptyTryBlock(),
thisModule.importFromSamePackage(),
thisModule.methodWithSameNameAsEnclosingClass(),
thisModule.missingBreakInSwitch(),
thisModule.suspiciousEqualsMethodName(),
thisModule.UnconditionalIfStatement(),
thisModule.UseProperClassLoader(),
-- Best practices rules
thisModule.useAssertTrueInsteadOfAssertEquals(),
thisModule.switchDensity(),
thisModule.useAssertSameInsteadOfAssertTrue(),
thisModule.switchDensity()
thisModule.useAssertTrueInsteadOfAssertEquals()
-- Bugged rules:
--
......@@ -129,7 +127,10 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
-- thisModule.unusedPrivateMethod ()
-- thisModule.avoidStringBufferField()
-- thisModule.avoidThrowingNewInstanceOfSameException(),
-- thisModule.stringToString(),
-- thisModule.dontCallThreadRun(),
-- thisModule.methodWithSameNameAsEnclosingClass(),
};
......@@ -1444,10 +1445,10 @@ rule MeasureMisLeadingVariableName(variable :java!VariableDeclarationFragment) {
),
noc: smm!DimensionalMeasure (
name <- 'MisLeadingVariableName',
shortDescription <- 'Detects when a non-field has a name starting with m_. This usually denotes a field and could be confusing.'
shortDescription <- 'Detects when a non-field has a name starting with m_. This usually denotes a field and could be confusing.'
),
measurement: smm!DirectMeasurement (
error<- 'Variable ' + variable.name + ' should not start with m_ as it is not a field.'
error<- 'Variable ' + variable.name + ' should not start with m_ as it is not a field.'
)
do {
noc;
......
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