sleekbyte/tailor

View on GitHub

Showing 185 of 185 total issues

BraceStyleListener has 53 methods (exceeds 20 allowed). Consider refactoring.
Open

public class BraceStyleListener extends SwiftBaseListener {

    private Printer printer;
    private BufferedTokenStream tokenStream;

Severity: Major
Found in src/main/java/com/sleekbyte/tailor/listeners/BraceStyleListener.java - About 7 hrs to fix

    File YamlConfigurationTest.java has 384 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package com.sleekbyte.tailor.functional.yaml;
    
    import static org.junit.Assert.assertArrayEquals;
    import static org.junit.Assert.assertTrue;
    
    

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

          @Test
          public void testPurge() throws IOException {
              addExpectedMsg(12, 15,
                  Rules.TERMINATING_SEMICOLON,
                  Messages.STATEMENTS + Messages.SEMICOLON,
      src/test/java/com/sleekbyte/tailor/functional/yaml/YamlConfigurationTest.java on lines 235..295

      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 283.

      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

          @Test
          public void testCliAndConfigFilePrecedence() throws IOException {
      
              addExpectedMsg(12, 15,
                  Rules.TERMINATING_SEMICOLON,
      src/test/java/com/sleekbyte/tailor/functional/yaml/YamlConfigurationTest.java on lines 317..376

      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 283.

      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

      class CheckSuperLongClassName {
      }
      
      let checkElementNameLength: (ename: Int, veryLongElementName: Int) = (1, 2)
      
      
      src/test/swift/com/sleekbyte/tailor/functional/MinNameLengthTest.swift on lines 1..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 262.

      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

      class Cl {
      }
      
      let checkElementNameLength: (ename: Int, veryLongElementName: Int) = (1, 2)
      
      
      src/test/swift/com/sleekbyte/tailor/functional/MaxNameLengthTest.swift on lines 1..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 262.

      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

      File FormatTest.java has 340 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package com.sleekbyte.tailor.functional;
      
      import static org.junit.Assert.assertArrayEquals;
      
      import com.github.mustachejava.DefaultMustacheFactory;
      Severity: Minor
      Found in src/test/java/com/sleekbyte/tailor/functional/FormatTest.java - About 4 hrs to fix

        File BraceStyleListener.java has 332 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package com.sleekbyte.tailor.listeners;
        
        import com.sleekbyte.tailor.antlr.SwiftBaseListener;
        import com.sleekbyte.tailor.antlr.SwiftParser;
        import com.sleekbyte.tailor.common.Location;
        Severity: Minor
        Found in src/main/java/com/sleekbyte/tailor/listeners/BraceStyleListener.java - About 4 hrs to fix

          Method addAllExpectedMsgs has 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              protected void addAllExpectedMsgs() {
                  // Type inheritance commas
                  int start = 9;
                  addExpectedCommaMessage(start, 24, Messages.NO_SPACE_BEFORE);

            Method addAllExpectedMsgs has 78 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Override
                protected void addAllExpectedMsgs() {
            
                    // Colons in type annotations
                    int start = 1;

              SourceFileUtilTest has 26 methods (exceeds 20 allowed). Consider refactoring.
              Open

              @RunWith(MockitoJUnitRunner.class)
              public class SourceFileUtilTest {
              
                  @Rule
                  public TestName testName = new TestName();
              Severity: Minor
              Found in src/test/java/com/sleekbyte/tailor/utils/SourceFileUtilTest.java - About 3 hrs to fix

                CLIArgumentParser has 26 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public final class CLIArgumentParser {
                
                    private Options options;
                    private CommandLine cmd;
                
                
                Severity: Minor
                Found in src/main/java/com/sleekbyte/tailor/utils/CLIArgumentParser.java - About 3 hrs to fix

                  Configuration has 24 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public final class Configuration {
                  
                      private static final String CONFIG_JSON = "../config.json";
                      private static final Path CODE_CLIMATE_CONFIG = Paths.get(CONFIG_JSON);
                      private static CLIArgumentParser CLIArgumentParser = new CLIArgumentParser();
                  Severity: Minor
                  Found in src/main/java/com/sleekbyte/tailor/utils/Configuration.java - About 2 hrs to fix

                    Method addAllExpectedMsgs has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @Override
                        protected void addAllExpectedMsgs() {
                            int start = 2;
                            addExpectedMsg(start, 1, Severity.WARNING, Messages.CLASS);
                            addExpectedMsg(start + 5, 5, Severity.WARNING, Messages.INITIALIZER_BODY);

                      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

                        CommaWhitespaceListener has 23 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        public final class CommaWhitespaceListener extends SwiftBaseListener {
                        
                            private WhitespaceVerifier verifier;
                        
                            public CommaWhitespaceListener(Printer printer) {

                          File Configuration.java has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          package com.sleekbyte.tailor.utils;
                          
                          import com.google.gson.Gson;
                          import com.google.gson.JsonSyntaxException;
                          import com.sleekbyte.tailor.common.ColorSettings;
                          Severity: Minor
                          Found in src/main/java/com/sleekbyte/tailor/utils/Configuration.java - About 2 hrs to fix

                            Printer has 22 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            public final class Printer implements Comparable<Printer> {
                            
                                private File inputFile;
                                private Severity maxSeverity;
                                private Formatter formatter;
                            Severity: Minor
                            Found in src/main/java/com/sleekbyte/tailor/output/Printer.java - About 2 hrs to fix

                              Identical blocks of code found in 3 locations. Consider refactoring.
                              Open

                                          if (msg.getColumnNumber() != 0) {
                                              begin.put(Messages.LINE_KEY, msg.getLineNumber());
                                              begin.put(Messages.COLUMN_KEY, msg.getColumnNumber());
                                              end.put(Messages.LINE_KEY, msg.getLineNumber());
                                              end.put(Messages.COLUMN_KEY, msg.getColumnNumber());
                              src/main/java/com/sleekbyte/tailor/format/CCFormatter.java on lines 39..51
                              src/test/java/com/sleekbyte/tailor/format/CCFormatterTest.java on lines 109..121

                              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 146.

                              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

                              Identical blocks of code found in 3 locations. Consider refactoring.
                              Open

                                          if (msg.getColumnNumber() != 0) {
                                              begin.put(Messages.LINE_KEY, msg.getLineNumber());
                                              begin.put(Messages.COLUMN_KEY, msg.getColumnNumber());
                                              end.put(Messages.LINE_KEY, msg.getLineNumber());
                                              end.put(Messages.COLUMN_KEY, msg.getColumnNumber());
                              src/main/java/com/sleekbyte/tailor/format/CCFormatter.java on lines 39..51
                              src/test/java/com/sleekbyte/tailor/functional/FormatTest.java on lines 339..351

                              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 146.

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language