Showing 114 of 114 total issues

TypeScriptParserBaseListener has 424 methods (exceeds 20 allowed). Consider refactoring.
Open

public class TypeScriptParserBaseListener implements TypeScriptParserListener {
    /**
     * {@inheritDoc}
     *
     * <p>The default implementation does nothing.</p>

    TypeScriptParserListener has 420 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public interface TypeScriptParserListener extends ParseTreeListener {
        /**
         * Enter a parse tree produced by {@link TypeScriptParser#initializer}.
         * @param ctx the parse tree
         */
    Severity: Major
    Found in docs/compare/src/main/java/tsantlr/TypeScriptParserListener.java - About 1 wk to fix

      PythonParserBaseListener has 160 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class PythonParserBaseListener implements PythonParserListener {
          /**
           * {@inheritDoc}
           *
           * <p>The default implementation does nothing.</p>
      Severity: Major
      Found in docs/compare/src/main/java/pyantlr/PythonParserBaseListener.java - About 3 days to fix

        PythonParserListener has 156 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public interface PythonParserListener extends ParseTreeListener {
            /**
             * Enter a parse tree produced by {@link PythonParser#root}.
             * @param ctx the parse tree
             */
        Severity: Major
        Found in docs/compare/src/main/java/pyantlr/PythonParserListener.java - About 3 days to fix

          File TypeScriptParserBaseListener.java has 430 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // Generated from TypeScriptParser.g4 by ANTLR 4.7.2
          package tsantlr;
          
          import org.antlr.v4.runtime.ParserRuleContext;
          import org.antlr.v4.runtime.tree.ErrorNode;
          Severity: Minor
          Found in docs/compare/src/main/java/tsantlr/TypeScriptParserBaseListener.java - About 6 hrs to fix

            File TypeScriptParserListener.java has 424 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // Generated from TypeScriptParser.g4 by ANTLR 4.7.2
            package tsantlr;
            
            import org.antlr.v4.runtime.tree.ParseTreeListener;
            
            
            Severity: Minor
            Found in docs/compare/src/main/java/tsantlr/TypeScriptParserListener.java - About 6 hrs to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              package app
              
              import (
                  "encoding/json"
                  "github.com/phodal/coca/cmd/cmd_util"
              Severity: Major
              Found in analysis/typescript/app/analysis.go and 1 other location - About 4 hrs to fix
              analysis/python/app/analysis.go on lines 1..45

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 314.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              package app
              
              import (
                  "encoding/json"
                  "github.com/phodal/coca/cmd/cmd_util"
              Severity: Major
              Found in analysis/python/app/analysis.go and 1 other location - About 4 hrs to fix
              analysis/typescript/app/analysis.go on lines 1..44

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 314.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              JavaFullListener has 25 methods (exceeds 20 allowed). Consider refactoring.
              Open

              type JavaFullListener struct {
                  parser.BaseJavaParserListener
              }
              Severity: Minor
              Found in pkg/infrastructure/ast/ast_java/java_full_listener.go - About 2 hrs to fix

                Function startParse has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
                Open

                func startParse(nodes []core_domain.CodeDataStruct, relates []support.RefactorChangeRelate) {
                    for _, pkgNode := range nodes {
                        for _, related := range relates {
                            oldInfo := support.BuildMethodPackageInfo(related.OldObj)
                            newInfo := support.BuildMethodPackageInfo(related.NewObj)
                Severity: Minor
                Found in pkg/application/refactor/rename/rename_method.go - About 2 hrs 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

                Function ParseXML has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
                Open

                func ParseXML(r io.Reader) *XMLNode {
                    parser := xml.NewDecoder(r)
                    var root XMLNode
                
                    st := container.NewStack()
                Severity: Minor
                Found in pkg/infrastructure/xmlparse/xml_parser.go - About 2 hrs 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

                Function ParseXML has 69 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func ParseXML(r io.Reader) *XMLNode {
                    parser := xml.NewDecoder(r)
                    var root XMLNode
                
                    st := container.NewStack()
                Severity: Minor
                Found in pkg/infrastructure/xmlparse/xml_parser.go - About 1 hr to fix

                  Method TbsApp.AnalysisPath has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
                  Open

                  func (a TbsApp) AnalysisPath(deps []core_domain.CodeDataStruct, identifiersMap map[string]core_domain.CodeDataStruct) []TestBadSmell {
                      var results []TestBadSmell = nil
                      callMethodMap := core_domain.BuildCallMethodMap(deps)
                      for _, clz := range deps {
                          for _, method := range clz.Functions {
                  Severity: Minor
                  Found in pkg/application/tbs/tbs_app.go - About 1 hr 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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  func TestInterface(t *testing.T) {
                      g := NewGomegaWithT(t)
                  
                      codePath := "../../../../_fixtures/grammar/java/interface"
                      codePath = filepath.FromSlash(codePath)
                  Severity: Major
                  Found in pkg/application/analysis/javaapp/java_full_app_test.go and 1 other location - About 1 hr to fix
                  pkg/application/analysis/javaapp/java_full_app_test.go on lines 88..103

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 172.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  func TestBadSmellApp_GraphCall(t *testing.T) {
                      g := NewGomegaWithT(t)
                  
                      bsApp := NewBadSmellApp()
                      codePath := "../../../_fixtures/bs/graphcall"
                  Severity: Major
                  Found in pkg/application/bs/bad_smell_app_test.go and 1 other location - About 1 hr to fix
                  pkg/application/bs/bad_smell_app_test.go on lines 36..49

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 172.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  func TestBadSmellApp_LongMethod(t *testing.T) {
                      g := NewGomegaWithT(t)
                  
                      bsApp := NewBadSmellApp()
                      codePath := "../../../_fixtures/bs/LongMethod.java"
                  Severity: Major
                  Found in pkg/application/bs/bad_smell_app_test.go and 1 other location - About 1 hr to fix
                  pkg/application/bs/bad_smell_app_test.go on lines 107..120

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 172.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  func TestAnnotation(t *testing.T) {
                      g := NewGomegaWithT(t)
                  
                      codePath := "../../../../_fixtures/grammar/java/regression/HostDependentDownloadableContribution.java"
                      codePath = filepath.FromSlash(codePath)
                  Severity: Major
                  Found in pkg/application/analysis/javaapp/java_full_app_test.go and 1 other location - About 1 hr to fix
                  pkg/application/analysis/javaapp/java_full_app_test.go on lines 70..86

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 172.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  func Test_IsSetter(t *testing.T) {
                      t.Parallel()
                      g := NewGomegaWithT(t)
                  
                      position := core_domain.CodePosition{
                  Severity: Major
                  Found in pkg/domain/bs_domain/bs_node_test.go and 1 other location - About 1 hr to fix
                  pkg/domain/bs_domain/bs_node_test.go on lines 9..35

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 165.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  func Test_IsGetter(t *testing.T) {
                      t.Parallel()
                      g := NewGomegaWithT(t)
                  
                      position := core_domain.CodePosition{
                  Severity: Major
                  Found in pkg/domain/bs_domain/bs_node_test.go and 1 other location - About 1 hr to fix
                  pkg/domain/bs_domain/bs_node_test.go on lines 37..63

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 165.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Method CocagoParser.Visitor has 64 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (n *CocagoParser) Visitor(f *ast.File, fset *token.FileSet, fileName string) *core_domain.CodeContainer {
                      var currentStruct core_domain.CodeDataStruct
                      var currentFile core_domain.CodeContainer
                      var currentFunc *core_domain.CodeFunction
                      var dsMap = make(map[string]*core_domain.CodeDataStruct)
                  Severity: Minor
                  Found in pkg/infrastructure/ast/ast_go/cocago_parser.go - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language