Skip to main content

Static Code Analysis Default Configuration

The following sections list the rules that are active for the default static code analysis configuration.

Java

Spotbugs

All tool categories and their rules are active by default except for the NOISE and EXPERIMENTAL category. Refer to the Spotbugs documentation for a description of all rules.

Checkstyle

This table contains all rules that are activated by default when creating a new programming exercise. You can suppress a complete category by changing its visibility in the grading settings. For a more fine-granular configuration, you can add or remove rules by editing the checkstyle-configuration.xml file. For a description of the rules refer to the Checkstyle documentation.

Category (Tool/Artemis)RuleProperties
Coding / Code StyleEmptyStatement
EqualsHashCode
HiddenFieldignoreConstructorParameter="true"
ignoreSetter="true"
setterCanReturnItsClass="true"
IllegalInstantiation
InnerAssignment
MagicNumber
MissingSwitchDefault
MultipleVariableDeclarations
SimplifyBooleanExpression
SimplifyBooleanReturn
Class Design / DesignFinalClass
HideUtilityClassConstructor
InterfaceIsType
VisibilityModifier
Block Checks / Code StyleAvoidNestedBlocks
EmptyBlock
NeedBraces
Modifiers / Code StyleModifierOrder
RedundantModifier
Size Violations / Code MetricsMethodLength
ParameterNumber
FileLength
LineLengthmax="120"
Imports / Naming & FormattingIllegalImport
RedundantImport
UnusedImportsprocessJavadoc="false"
Naming Conventions / Naming & FormattingConstantName
LocalFinalVariableName
LocalVariableName
MemberName
MethodName
ParameterName
StaticVariableName
TypeName
Whitespace / Naming & FormattingEmptyForIteratorPad
GenericWhitespace
MethodParamPad
NoWhitespaceAfter
NoWhitespaceBefore
OperatorWrap
ParenPad
TypecastParenPad
WhitespaceAfter
WhitespaceAround
Javadoc Comments / DocumentationInvalidJavadocPosition
JavadocMethod
JavadocType
JavadocStyle
MissingJavadocMethodallowMissingPropertyJavadoc="true"
allowedAnnotations="Override,Test"
tokens="METHOD_DEF,ANNOTATION_FIELD_DEF,COMPACT_CTOR_DEF"
Miscellaneous / MiscellaneousArrayTypeStyle
RegexpSinglelineflags trailing whitespace
UpperEll
NewlineAtEndOfFile
Translation

PMD

For a description of the rules refer to the PMD documentation.

Category (Tool/Artemis)Rule
Best Practices / Bad PracticeAvoidUsingHardCodedIP
CheckResultSet
UnusedFormalParameter
UnusedLocalVariable
UnusedPrivateField
UnusedPrivateMethod
PrimitiveWrapperInstantiation
Code Style / Code StyleUnnecessaryImport
ExtendsObject
ForLoopShouldBeWhileLoop
TooManyStaticImports
UnnecessaryFullyQualifiedName
UnnecessaryModifier
UnnecessaryReturn
UselessParentheses
UselessQualifiedThis
EmptyControlStatement
Documentation / Documentationall rules of the category
Design / DesignCollapsibleIfStatements
SimplifiedTernary
UselessOverridingMethod
Error Prone / Potential BugsAvoidBranchingStatementAsLastInLoop
AvoidDecimalLiteralsInBigDecimalConstructor
AvoidMultipleUnaryOperators
AvoidUsingOctalValues
BrokenNullCheck
CheckSkipResult
ClassCastExceptionWithToArray
DontUseFloatTypeForLoopIndices
JumbledIncrementer
MisplacedNullCheck
OverrideBothEqualsAndHashcode
ReturnFromFinallyBlock
UnconditionalIfStatement
UnnecessaryConversionTemporary
UnusedNullCheckInEquals
UselessOperationOnImmutable
Multithreading / Potential BugsAvoidThreadGroup
DontCallThreadRun
DoubleCheckedLocking
Performance / PerformanceBigIntegerInstantiation
Security / SecurityAll rules

PMD CPD

Artemis uses the following default configuration to detect code duplications for the category Copy/Paste Detection. For a description of the various PMD CPD configuration parameters refer to the PMD CPD documentation.

<!-- Minimum amount of duplicated tokens triggering the copy-paste detection -->
<minimumTokens>60</minimumTokens>
<!-- Ignore literal value differences when evaluating a duplicate block.
If true, foo=42; and foo=43; will be seen as equivalent -->
<ignoreLiterals>true</ignoreLiterals>
<!-- Similar to ignoreLiterals but for identifiers, i.e. variable names, methods names.
If activated, most tokens will be ignored, so minimumTokens must be lowered significantly -->
<ignoreIdentifiers>false</ignoreIdentifiers>

C

GCC

For a description of the rules/warnings refer to the GCC Documentation. For readability reasons the rule/warning prefix -Wanalyzer- is omitted.

Category (Tool/Artemis)Rule
Memory Management / Potential Bugsfree-of-non-heap
malloc-leak
file-leak
mismatching-deallocation
Undefined Behavior / Potential Bugsdouble-free
null-argument
use-after-free
use-of-uninitialized-value
write-to-const
write-to-string-literal
possible-null-argument
possible-null-dereference
Bad Practice / Bad Practicedouble-fclose
too-complex
stale-setjmp-buffer
Security / Securityexposure-through-output-file
unsafe-call-within-signal-handler
use-of-pointer-in-stale-stack-frame
tainted-array-index
Miscellaneous / MiscellaneousRules not matching to above categories
Search documentation