CodeNarc Report

The following document contains the results of CodeNarc analysis

CodeNarc Version: 1.5

Report time: 20 maj 2020, 00:06:22

Summary

Total Files Files with Violations Total Violations Priority 1 Violations Priority 2 Violations Priority 3 Violations
3 2 5 0 5 0

Package Summary

Source Directory: src/main/groovy

Package Files with Violations Total Violations Priority 1 Violations Priority 2 Violations Priority 3 Violations
com.example 1 3 0 3 0
com.example.nestedpackage 1 2 0 2 0

Files

Source Directory: src/main/groovy

com/example/TestClassWithSomeViolations.groovy

Rule Name Priority Line Source Line / Message
DuplicateMapKey 2 5

private static final Map DUPLICATE_MAP_KEY = [a: 1, a: 2]

Key 'a' is duplicated.

BrokenNullCheck 2 8

if (name != null || name.length * 0) { }

The expression ((name != null) || (name.length * 0)) within class com.example.TestClassWithSomeViolations incorrectly checks for null, and can throw a NullPointerException.

EmptyIfStatement 2 8

if (name != null || name.length * 0) { }

The if statement is empty

com/example/nestedpackage/TestClassWithSomeMoreViolations.groovy

Rule Name Priority Line Source Line / Message
DeadCode 2 7

return 1

This code cannot be reached

EmptyIfStatement 2 11

if (a % 2 == 0) {}

The if statement is empty