sleekbyte/tailor

View on GitHub
src/main/java/com/sleekbyte/tailor/Tailor.java

Summary

Maintainability
C
1 day
Test Coverage

File Tailor.java has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.sleekbyte.tailor;

import com.sleekbyte.tailor.antlr.SwiftBaseListener;
import com.sleekbyte.tailor.antlr.SwiftLexer;
import com.sleekbyte.tailor.antlr.SwiftParser;
Severity: Minor
Found in src/main/java/com/sleekbyte/tailor/Tailor.java - About 2 hrs to fix

    Method analyzeFiles has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private void analyzeFiles(Set<String> fileNames) throws CLIArgumentParserException, IOException {
            ColorSettings colorSettings =
                new ColorSettings(configuration.shouldColorOutput(), configuration.shouldInvertColorOutput());
            Formatter formatter = configuration.getFormatter(colorSettings);
            Severity maxSeverity = configuration.getMaxSeverity();
    Severity: Minor
    Found in src/main/java/com/sleekbyte/tailor/Tailor.java - About 1 hr to fix

      Method main has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static void main(String[] args) {
              Tailor tailor = new Tailor();
      
              try {
                  tailor.configuration = new Configuration(args);
      Severity: Minor
      Found in src/main/java/com/sleekbyte/tailor/Tailor.java - About 1 hr to fix

        Method createListeners has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            private List<SwiftBaseListener> createListeners(Set<Rules> enabledRules,
                                                            Printer printer,
                                                            CommonTokenStream tokenStream,
                                                            ConstructLengths constructLengths,
                                                            CommentExtractor commentExtractor)
        Severity: Minor
        Found in src/main/java/com/sleekbyte/tailor/Tailor.java - 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

        Method createListeners has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private List<SwiftBaseListener> createListeners(Set<Rules> enabledRules,
                                                            Printer printer,
                                                            CommonTokenStream tokenStream,
                                                            ConstructLengths constructLengths,
                                                            CommentExtractor commentExtractor)
        Severity: Minor
        Found in src/main/java/com/sleekbyte/tailor/Tailor.java - About 1 hr to fix

          Method analyzeFile has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private void analyzeFile(File inputFile,
                                       Optional<CommonTokenStream> optTokenStream,
                                       Optional<TopLevelContext> optTree,
                                       Formatter formatter,
                                       Severity maxSeverity,
          Severity: Minor
          Found in src/main/java/com/sleekbyte/tailor/Tailor.java - About 1 hr to fix

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

                public static void main(String[] args) {
                    Tailor tailor = new Tailor();
            
                    try {
                        tailor.configuration = new Configuration(args);
            Severity: Minor
            Found in src/main/java/com/sleekbyte/tailor/Tailor.java - About 55 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 analyzeFile has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private void analyzeFile(File inputFile,
                                         Optional<CommonTokenStream> optTokenStream,
                                         Optional<TopLevelContext> optTree,
                                         Formatter formatter,
                                         Severity maxSeverity,
            Severity: Major
            Found in src/main/java/com/sleekbyte/tailor/Tailor.java - About 50 mins to fix

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

                  private List<SwiftBaseListener> createListeners(Set<Rules> enabledRules,
                                                                  Printer printer,
                                                                  CommonTokenStream tokenStream,
                                                                  ConstructLengths constructLengths,
                                                                  CommentExtractor commentExtractor)
              Severity: Minor
              Found in src/main/java/com/sleekbyte/tailor/Tailor.java - About 35 mins to fix

                There are no issues that match your filters.

                Category
                Status