sleekbyte/tailor

View on GitHub

Showing 84 of 185 total issues

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

    private void addExpectedMsg(Rules rule, int line, String msg, int length, int limit) {
Severity: Minor
Found in src/test/java/com/sleekbyte/tailor/functional/ConstructLengthTest.java - About 35 mins to fix

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

        private void lineLengthViolation(int lineNumber, int lineLength, int lengthLimit,  Rules rule, String msg) {
    Severity: Minor
    Found in src/main/java/com/sleekbyte/tailor/listeners/FileListener.java - About 35 mins to fix

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

          private void addExpectedNameMsg(int line, int column, String msg, int length, int limit) {
      Severity: Minor
      Found in src/test/java/com/sleekbyte/tailor/functional/MaxNameLengthTest.java - About 35 mins to fix

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

            private void addExpectedLineMsg(int line, int column, String msg, int length, int limit) {
        Severity: Minor
        Found in src/test/java/com/sleekbyte/tailor/functional/MaxNameLengthTest.java - About 35 mins to fix

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

              public static String genOutputStringForTest(Rules rule, String filePath, int line, Severity severity, String msg) {
          Severity: Minor
          Found in src/main/java/com/sleekbyte/tailor/output/Printer.java - About 35 mins to fix

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

                private void addExpectedMsg(Rules rule, int line, int column, Severity severity, String msg) {

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

                  private void validateViolationMessage(ViolationMessage message, Rules rule, String msg,
                                                           int line, int column) {
              Severity: Minor
              Found in src/test/java/com/sleekbyte/tailor/output/PrinterTest.java - About 35 mins to fix

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

                    public static String genOutputStringForTest(String filePath, int line, int column, Severity severity, String msg) {
                Severity: Minor
                Found in src/main/java/com/sleekbyte/tailor/output/Printer.java - About 35 mins to fix

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

                      private void addExpectedMsg(int line, int column, Rules rule, String msg, String fileName) {

                    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

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

                          public Set<Rules> getEnabledRules() throws CLIArgumentParserException {
                              // --only is given precedence over --except
                              // CLI input is given precedence over YAML configuration file
                      
                              // Retrieve included or excluded rules from CLI
                      Severity: Minor
                      Found in src/main/java/com/sleekbyte/tailor/utils/Configuration.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 compareTo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          @Override
                          public int compareTo(final ViolationMessage message) {
                              int ret = this.lineNumber - message.lineNumber;
                              if (ret == 0) {
                                  ret = this.columnNumber - message.columnNumber;
                      Severity: Minor
                      Found in src/main/java/com/sleekbyte/tailor/output/ViolationMessage.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 extractComments has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private void extractComments() {
                              for (Token token : tokenStream.getTokens()) {
                                  if (token.getChannel() != Token.HIDDEN_CHANNEL) {
                                      continue;
                                  }
                      Severity: Minor
                      Found in src/main/java/com/sleekbyte/tailor/utils/CommentExtractor.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 equals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          @Override
                          public boolean equals(Object obj) {
                              if (this == obj) {
                                  return true;
                              }
                      Severity: Minor
                      Found in src/main/java/com/sleekbyte/tailor/output/ViolationMessage.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

                      Avoid too many return statements within this method.
                      Open

                              return new HashSet<>(Arrays.asList(Rules.values()));
                      Severity: Major
                      Found in src/main/java/com/sleekbyte/tailor/utils/Configuration.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return;

                          Avoid too many return statements within this method.
                          Open

                                      return;

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

                                private static int getNumberOfBlankLines(List<Token> tokens) {
                                    if (tokens == null || tokens.size() <= 1) {
                                        return 0;
                                    }
                            
                            
                            Severity: Minor
                            Found in src/main/java/com/sleekbyte/tailor/listeners/BlankLineListener.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 commentLeftOfCloseBrace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private boolean commentLeftOfCloseBrace(Token closeBraceToken) {
                                    Location closeBraceLocation = ListenerUtil.getTokenLocation(closeBraceToken);
                                    List<Token> tokens = tokenStream.getHiddenTokensToLeft(closeBraceToken.getTokenIndex());
                                    // if comments are to the left of }
                                    if (tokens != null) {
                            Severity: Minor
                            Found in src/main/java/com/sleekbyte/tailor/listeners/BraceStyleListener.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 getFormat has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private Format getFormat() throws CLIArgumentParserException, YAMLException {
                                    // Try to get format from CLI/config file. Else use the default format (XCODE)
                                    Format format = Format.XCODE;
                                    if (CLIArgumentParser.formatOptionSet()) {
                                        format = CLIArgumentParser.getFormat();
                            Severity: Minor
                            Found in src/main/java/com/sleekbyte/tailor/utils/Configuration.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