tomokinakamaru/silverchain

View on GitHub

Showing 24 of 85 total issues

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

  @SuppressWarnings("ResultOfMethodCallIgnored")
  private static void delete(File file) {
    if (!file.exists()) {
      return;
    }
Severity: Minor
Found in src/test/java/command/Tests.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

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

  private String findFqn(String name, Node node) {
    CompilationUnit unit = getCompilationUnit(node);

    String head = name.split("\\.")[0];
    String tail = name.substring(head.length());
Severity: Minor
Found in src/main/java/silverchain/javadoc/Javadocs.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

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

  @Override
  public RepeatOperator visitRepeatOperator(AgParser.RepeatOperatorContext ctx) {
    if (ctx.repeatOperator0X() != null) {
      return visitRepeatOperator0X(ctx.repeatOperator0X());
    }
Severity: Minor
Found in src/main/java/silverchain/parser/adapter/ASTBuilder.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

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

  private String getComment(MethodDeclaration declaration) {
    if (!declaration.hasJavaDocComment()) {
      return null;
    }

Severity: Minor
Found in src/main/java/silverchain/javadoc/Javadocs.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

Severity
Category
Status
Source
Language