sleekbyte/tailor

View on GitHub

Showing 84 of 185 total issues

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

            private void addExpectedMsg(Rules rule, int line, int column, Severity classification, String msg) {
        Severity: Minor
        Found in src/test/java/com/sleekbyte/tailor/functional/FileRulesTest.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 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 addExpectedMsg has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

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

                      private void addExpectedMsg(Rules rule, int line, int column, Severity severity, String msg) {
                  Severity: Minor
                  Found in src/test/java/com/sleekbyte/tailor/functional/ConstantNamingTest.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 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

                      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

                      Avoid too many return statements within this method.
                      Open

                                  return;

                        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;

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

                                private String formattedSeverity() {
                                    String res;
                                    if (colorSettings.colorOutput) {
                                        res = String.format("%7s:", severity);
                                        if (severity.equals(Severity.ERROR)) {
                            Severity: Minor
                            Found in src/main/java/com/sleekbyte/tailor/output/ViolationMessage.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 enterOperatorDeclaration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                @Override
                                public void enterOperatorDeclaration(SwiftParser.OperatorDeclarationContext ctx) {
                                    for (int i = 0; i < ctx.getChild(0).getChildCount(); i++) {
                                        if (ctx.getChild(0).getChild(i) instanceof SwiftParser.OperatorContext) {
                                            SwiftParser.OperatorContext op = (SwiftParser.OperatorContext) ctx.getChild(0).getChild(i);

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

                                public static ParserRuleContext getConstantDeclaration(ParserRuleContext ctx) {
                                    if (ctx.getParent() != null) {
                                        if (ctx.getParent() instanceof SwiftParser.ConstantDeclarationContext) {
                                            return ctx.getParent();
                                        } else {
                            Severity: Minor
                            Found in src/main/java/com/sleekbyte/tailor/listeners/ConstantDecHelper.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