funkygao/cp-ddd-framework

View on GitHub

Showing 109 of 168 total issues

Method parse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public KeyRelationEntry parse(AnnotationExpr keyRelation) {
        KeyRelationEntry entry = new KeyRelationEntry();
        entry.setJavadoc(JavaParserUtil.javadocFirstLineOf(leftClassDeclaration));
        entry.setLeftClass(leftClassDeclaration.getNameAsString());
        entry.setLeftClassPackageName(JavaParserUtil.packageName(leftClassDeclaration));

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 hasKeyMethod has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean hasKeyMethod(String methodName) {
        for (KeyBehaviorEntry entry : keyBehaviorEntries) {
            if (entry.getRealMethodName().equals(methodName)) {
                return true;
            }

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 invokeExtension has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private R invokeExtension(ExtensionDef extensionDef, final Method method, Object[] args) throws Throwable {
        try {
            ExtensionContext context = null;
            if (interceptor != null) {
                context = new ExtensionContext(extensionDef.getCode(), extensionDef.getExtensionBean(), method, args);

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 visit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void visit(final MethodDeclaration methodDeclaration, final KeyUsecaseReport report) {
        super.visit(methodDeclaration, report);

        if (!methodDeclaration.isAnnotationPresent(KeyUsecase.class)) {

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 executeSteps has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private List<String> executeSteps(String activityCode, List<String> stepCodes, Stack<IRevokableDomainStep> executedSteps, Model model,
                                      SchedulingTaskExecutor taskExecutor, Set<String> asyncStepCodes) throws RuntimeException {

    Method writeKeyUsecaseClazzDefinition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private PlainTextRenderer writeKeyUsecaseClazzDefinition(String actor) {
            append(actor).append(NEWLINE);
            for (KeyUsecaseEntry entry : model.getKeyUsecaseReport().sortedActorKeyUsecases(actor)) {
                append(TAB);
                if (!entry.displayOut().isEmpty()) {

    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 deeply nested control flow statements.
    Open

                                if (first) {
                                    entry.setRootClass(classExpr.getTypeAsString());
                                    first = false;
                                } else {
                                    entry.addExtraRootClass(classExpr.getTypeAsString());

      Method visit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public void visit(final MethodDeclaration methodDeclaration, final KeyFlowReport report) {
              super.visit(methodDeclaration, report);
      
              if (!methodDeclaration.isAnnotationPresent(KeyFlow.class)) {

      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 deeply nested control flow statements.
      Open

                              if (clusters.get(i).isEmpty()) {
                                  continue;
                              }

        Method add has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public KeyRelationReport add(KeyRelationEntry entry) {
                // dup check
                for (KeyRelationEntry relationEntry : relationEntries) {
                    if (relationEntry.sameAs(entry)) {
                        throw new RuntimeException(String.format("Dup Key Relation: existed %s, new entry %s",

        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 findExtension has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private <Ext extends IDomainExtension, R> Ext findExtension(@NonNull Class<Ext> extClazz, @NonNull Identity identity, IReducer<R> reducer, Ext defaultExt, int timeoutInMs) {
        Severity: Minor
        Found in dddplus-runtime/src/main/java/io/github/dddplus/runtime/BaseRouter.java - About 35 mins to fix

          Method execute has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public final void execute(String activityCode, List<String> stepCodes, Model model,
                                        SchedulingTaskExecutor taskExecutor, Set<String> asyncStepCodes) throws RuntimeException {

            Method loadPartnerPlugin has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public synchronized void loadPartnerPlugin(@NonNull String code, @NonNull String version, @NonNull String jarPath, boolean useSpring, IContainerContext containerContext) throws Throwable {

              Method callerRecords has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  private Collection<Record> callerRecords() {
                      List<Record> records = new ArrayList<>();
                      Set<String> callerClasses = new TreeSet<>();
                      for (CallGraphEntry entry : entries) {
                          callerClasses.add(entry.getCallerClazz());

              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 visit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  public void visit(final MethodDeclaration methodDeclaration, final KeyBehaviorReport report) {
                      super.visit(methodDeclaration, report);
              
                      if (!methodDeclaration.isAnnotationPresent(KeyBehavior.class)) {

              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 visit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  public void visit(final EnumConstantDeclaration fieldDeclaration, final KeyModelReport report) {
                      super.visit(fieldDeclaration, report);
              
                      if (!fieldDeclaration.isAnnotationPresent(KeyElement.class)

              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 hasOrphanFlowEntries has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public boolean hasOrphanFlowEntries() {
                      if (actors().isEmpty()) {
                          return false;
                      }
              
              

              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 allOf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Deprecated
                  static <R> IReducer<R> allOf(Predicate<R> predicate) {
                      return new IReducer<R>() {
                          @Override
                          public R reduce(List<R> accumulatedResults) {
              Severity: Minor
              Found in dddplus-runtime/src/main/java/io/github/dddplus/runtime/IReducer.java - About 35 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 walkFrom has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  private void walkFrom(int level, String path, File file) {
                      if (file.isDirectory()) {
                          for (File child : file.listFiles()) {
                              walkFrom(level + 1, path + "/" + child.getName(), child);
                          }

              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 writeKeyUsecaseClazzDefinition has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  private PlantUmlRenderer writeKeyUsecaseClazzDefinition(String actor) {
                      append("class ").append(actor);
                      String actorJavadoc = model.getKeyUsecaseReport().actorJavadoc(actor);
                      if (actorJavadoc != null && !actorJavadoc.isEmpty()) {
                          append(String.format(" <<(C,#9197DB) %s>> ", actorJavadoc));

              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