koraktor/mavanagaiata

View on GitHub

Showing 68 of 68 total issues

Method execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public final void execute()
            throws MojoExecutionException, MojoFailureException {
        if (skip) {
            return;
        }
Severity: Minor
Found in src/main/java/com/github/koraktor/mavanagaiata/mojo/AbstractGitMojo.java - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Avoid excessively long variable names like dirtyIgnoreUntracked
Open

    boolean dirtyIgnoreUntracked;

LongVariable

Since: PMD 0.3

Priority: Medium

Categories: Style

Remediation Points: 50000

Fields, formal arguments, or local variable names that are too long can make the code difficult to follow.

Example:

public class Something {
 int reallyLongIntName = -3; // VIOLATION - Field
 public static void main( String argumentsList[] ) { // VIOLATION - Formal
 int otherReallyLongName = -5; // VIOLATION - Local
 for (int interestingIntIndex = 0; // VIOLATION - For
 interestingIntIndex < 10;
 interestingIntIndex ++ ) {
 }
}

Private field 'distance' could be made final; it is only initialized in the declaration or constructor.
Open

    private int distance;

ImmutableField

Since: PMD 2.0

Priority: Medium

Categories: Style

Remediation Points: 50000

Identifies private fields whose values never change once they are initialized either in the declaration of the field or by a constructor. This helps in converting existing classes to becoming immutable ones.

Example:

public class Foo {
 private int x; // could be final
 public Foo() {
 x = 7;
 }
 public void foo() {
 int a = x + 2;
 }
}

Avoid excessively long variable names like MAIL_TO_NAME_AND_MAIL_PATTERN
Open

    private static final Pattern MAIL_TO_NAME_AND_MAIL_PATTERN;

LongVariable

Since: PMD 0.3

Priority: Medium

Categories: Style

Remediation Points: 50000

Fields, formal arguments, or local variable names that are too long can make the code difficult to follow.

Example:

public class Something {
 int reallyLongIntName = -3; // VIOLATION - Field
 public static void main( String argumentsList[] ) { // VIOLATION - Formal
 int otherReallyLongName = -5; // VIOLATION - Local
 for (int interestingIntIndex = 0; // VIOLATION - For
 interestingIntIndex < 10;
 interestingIntIndex ++ ) {
 }
}

Avoid excessively long variable names like nameAndMailToNameAndMailMap
Open

    Map<Map.Entry<String, String>, Map.Entry<String, String>> nameAndMailToNameAndMailMap;

LongVariable

Since: PMD 0.3

Priority: Medium

Categories: Style

Remediation Points: 50000

Fields, formal arguments, or local variable names that are too long can make the code difficult to follow.

Example:

public class Something {
 int reallyLongIntName = -3; // VIOLATION - Field
 public static void main( String argumentsList[] ) { // VIOLATION - Formal
 int otherReallyLongName = -5; // VIOLATION - Local
 for (int interestingIntIndex = 0; // VIOLATION - For
 interestingIntIndex < 10;
 interestingIntIndex ++ ) {
 }
}

Private field 'committer' could be made final; it is only initialized in the declaration or constructor.
Open

    private PersonIdent committer;

ImmutableField

Since: PMD 2.0

Priority: Medium

Categories: Style

Remediation Points: 50000

Identifies private fields whose values never change once they are initialized either in the declaration of the field or by a constructor. This helps in converting existing classes to becoming immutable ones.

Example:

public class Foo {
 private int x; // could be final
 public Foo() {
 x = 7;
 }
 public void foo() {
 int a = x + 2;
 }
}

Avoid excessively long variable names like tempSourceFileStream
Open

            try (FileOutputStream tempSourceFileStream = new FileOutputStream(tempSourceFile)) {

LongVariable

Since: PMD 0.3

Priority: Medium

Categories: Style

Remediation Points: 50000

Fields, formal arguments, or local variable names that are too long can make the code difficult to follow.

Example:

public class Something {
 int reallyLongIntName = -3; // VIOLATION - Field
 public static void main( String argumentsList[] ) { // VIOLATION - Formal
 int otherReallyLongName = -5; // VIOLATION - Local
 for (int interestingIntIndex = 0; // VIOLATION - For
 interestingIntIndex < 10;
 interestingIntIndex ++ ) {
 }
}

Avoid excessively long variable names like commitMessagePattern
Open

    Pattern commitMessagePattern;

LongVariable

Since: PMD 0.3

Priority: Medium

Categories: Style

Remediation Points: 50000

Fields, formal arguments, or local variable names that are too long can make the code difficult to follow.

Example:

public class Something {
 int reallyLongIntName = -3; // VIOLATION - Field
 public static void main( String argumentsList[] ) { // VIOLATION - Formal
 int otherReallyLongName = -5; // VIOLATION - Local
 for (int interestingIntIndex = 0; // VIOLATION - For
 interestingIntIndex < 10;
 interestingIntIndex ++ ) {
 }
}

Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings
Open

                    abbrevId += dirtyFlag;

UseStringBufferForStringAppends

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

The use of the '+=' operator for appending strings causes the JVM to create and use an internal StringBuffer. If a non-trivial number of these concatenations are being used then the explicit use of a StringBuilder or threadsafe StringBuffer is recommended to avoid this.

Example:

public class Foo {
 void bar() {
 String a;
 a = 'foo';
 a += ' bar';
 // better would be:
 // StringBuilder a = new StringBuilder('foo');
 // a.append(' bar');
 }
}

Avoid reassigning parameters such as 'name'
Open

    private String escapeName(String name) {

AvoidReassigningParameters

Since: PMD 1.0

Priority: Medium High

Categories: Style

Remediation Points: 50000

Reassigning values to incoming parameters is not recommended. Use temporary local variables instead.

Example:

public class Foo {
 private void foo(String bar) {
 bar = 'something else';
 }
}

When instantiating a SimpleDateFormat object, specify a Locale
Open

        values.put("TIMESTAMP", new SimpleDateFormat(dateFormat).format(new Date()));

SimpleDateFormatNeedsLocale

Since: PMD 2.0

Priority: Medium

Categories: Style

Remediation Points: 50000

Be sure to specify a Locale when creating SimpleDateFormat instances to ensure that locale-appropriate formatting is used.

Example:

public class Foo {
 // Should specify Locale.US (or whatever)
 private SimpleDateFormat sdf = new SimpleDateFormat('pattern');
}

Avoid excessively long variable names like skipCommitsMatching
Open

    String skipCommitsMatching;

LongVariable

Since: PMD 0.3

Priority: Medium

Categories: Style

Remediation Points: 50000

Fields, formal arguments, or local variable names that are too long can make the code difficult to follow.

Example:

public class Something {
 int reallyLongIntName = -3; // VIOLATION - Field
 public static void main( String argumentsList[] ) { // VIOLATION - Formal
 int otherReallyLongName = -5; // VIOLATION - Local
 for (int interestingIntIndex = 0; // VIOLATION - For
 interestingIntIndex < 10;
 interestingIntIndex ++ ) {
 }
}

When instantiating a SimpleDateFormat object, specify a Locale
Open

            SimpleDateFormat dateFormat = new SimpleDateFormat(this.dateFormat);

SimpleDateFormatNeedsLocale

Since: PMD 2.0

Priority: Medium

Categories: Style

Remediation Points: 50000

Be sure to specify a Locale when creating SimpleDateFormat instances to ensure that locale-appropriate formatting is used.

Example:

public class Foo {
 // Should specify Locale.US (or whatever)
 private SimpleDateFormat sdf = new SimpleDateFormat('pattern');
}

Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings
Open

                describe += dirtyFlag;

UseStringBufferForStringAppends

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

The use of the '+=' operator for appending strings causes the JVM to create and use an internal StringBuffer. If a non-trivial number of these concatenations are being used then the explicit use of a StringBuilder or threadsafe StringBuffer is recommended to avoid this.

Example:

public class Foo {
 void bar() {
 String a;
 a = 'foo';
 a += ' bar';
 // better would be:
 // StringBuilder a = new StringBuilder('foo');
 // a.append(' bar');
 }
}

Avoid excessively long variable names like mailToNameAndMailMap
Open

    Map<String, Map.Entry<String, String>> mailToNameAndMailMap;

LongVariable

Since: PMD 0.3

Priority: Medium

Categories: Style

Remediation Points: 50000

Fields, formal arguments, or local variable names that are too long can make the code difficult to follow.

Example:

public class Something {
 int reallyLongIntName = -3; // VIOLATION - Field
 public static void main( String argumentsList[] ) { // VIOLATION - Formal
 int otherReallyLongName = -5; // VIOLATION - Local
 for (int interestingIntIndex = 0; // VIOLATION - For
 interestingIntIndex < 10;
 interestingIntIndex ++ ) {
 }
}

Avoid excessively long variable names like originalGitDirPath
Open

            String originalGitDirPath = readFileToString(originalGitDirFile, UTF_8).trim();

LongVariable

Since: PMD 0.3

Priority: Medium

Categories: Style

Remediation Points: 50000

Fields, formal arguments, or local variable names that are too long can make the code difficult to follow.

Example:

public class Something {
 int reallyLongIntName = -3; // VIOLATION - Field
 public static void main( String argumentsList[] ) { // VIOLATION - Formal
 int otherReallyLongName = -5; // VIOLATION - Local
 for (int interestingIntIndex = 0; // VIOLATION - For
 interestingIntIndex < 10;
 interestingIntIndex ++ ) {
 }
}

Avoid excessively long variable names like skipCommitsPattern
Open

    private Pattern skipCommitsPattern;

LongVariable

Since: PMD 0.3

Priority: Medium

Categories: Style

Remediation Points: 50000

Fields, formal arguments, or local variable names that are too long can make the code difficult to follow.

Example:

public class Something {
 int reallyLongIntName = -3; // VIOLATION - Field
 public static void main( String argumentsList[] ) { // VIOLATION - Formal
 int otherReallyLongName = -5; // VIOLATION - Local
 for (int interestingIntIndex = 0; // VIOLATION - For
 interestingIntIndex < 10;
 interestingIntIndex ++ ) {
 }
}

Avoid excessively long variable names like MARKDOWN_TRANSLATOR
Open

    private static final CharSequenceTranslator MARKDOWN_TRANSLATOR = new LookupTranslator(MARKDOWN_TRANSLATION_MAP);

LongVariable

Since: PMD 0.3

Priority: Medium

Categories: Style

Remediation Points: 50000

Fields, formal arguments, or local variable names that are too long can make the code difficult to follow.

Example:

public class Something {
 int reallyLongIntName = -3; // VIOLATION - Field
 public static void main( String argumentsList[] ) { // VIOLATION - Formal
 int otherReallyLongName = -5; // VIOLATION - Local
 for (int interestingIntIndex = 0; // VIOLATION - For
 interestingIntIndex < 10;
 interestingIntIndex ++ ) {
 }
}

Avoid excessively long variable names like MAIL_TO_MAIL_PATTERN
Open

    private static final Pattern MAIL_TO_MAIL_PATTERN;

LongVariable

Since: PMD 0.3

Priority: Medium

Categories: Style

Remediation Points: 50000

Fields, formal arguments, or local variable names that are too long can make the code difficult to follow.

Example:

public class Something {
 int reallyLongIntName = -3; // VIOLATION - Field
 public static void main( String argumentsList[] ) { // VIOLATION - Formal
 int otherReallyLongName = -5; // VIOLATION - Local
 for (int interestingIntIndex = 0; // VIOLATION - For
 interestingIntIndex < 10;
 interestingIntIndex ++ ) {
 }
}

Document empty constructor
Open

    JGitRepository() {}

UncommentedEmptyConstructor

Since: PMD 3.4

Priority: Medium

Categories: Style

Remediation Points: 50000

Uncommented Empty Constructor finds instances where a constructor does not contain statements, but there is no comment. By explicitly commenting empty constructors it is easier to distinguish between intentional (commented) and unintentional empty constructors.

Example:

public Foo() {
 // This constructor is intentionally empty. Nothing special is needed here.
}
Severity
Category
Status
Source
Language