sleekbyte/tailor

View on GitHub

Showing 185 of 185 total issues

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

    switch character {
    case "a", "e", "i", "o", "u", " ":
        continue
    default:
        puzzleOutput.append(character)
Severity: Major
Found in src/test/swift/com/sleekbyte/tailor/grammar/ControlFlow.swift and 3 other locations - About 40 mins to fix
src/test/swift/com/sleekbyte/tailor/functional/CommaWhitespaceTest.swift on lines 295..298
src/test/swift/com/sleekbyte/tailor/functional/CommaWhitespaceTest.swift on lines 300..303
src/test/swift/com/sleekbyte/tailor/functional/CommaWhitespaceTest.swift on lines 305..309

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

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 4 locations. Consider refactoring.
Open

switch character {
case "a" , "e",  "i","o", "u", " ": continue
default: puzzleOutput.append(character)
}
src/test/swift/com/sleekbyte/tailor/functional/CommaWhitespaceTest.swift on lines 295..298
src/test/swift/com/sleekbyte/tailor/functional/CommaWhitespaceTest.swift on lines 305..309
src/test/swift/com/sleekbyte/tailor/grammar/ControlFlow.swift on lines 120..125

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

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

      if temperatureInFahrenheit <= 32 {
          println("It's very cold. Consider wearing a scarf.");
      } else if temperatureInFahrenheit >= 86 {
          println("It's really warm. Don't forget to wear sunscreen.");
      } else {
src/test/swift/com/sleekbyte/tailor/grammar/ControlFlow.swift on lines 45..51

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

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

if temperatureInFahrenheit <= 32 {
    print("It's very cold. Consider wearing a scarf.")
} else if temperatureInFahrenheit >= 86 {
    print("It's really warm. Don't forget to wear sunscreen.")
} else {
Severity: Minor
Found in src/test/swift/com/sleekbyte/tailor/grammar/ControlFlow.swift and 1 other location - About 40 mins to fix
src/test/swift/com/sleekbyte/tailor/functional/yaml/YamlTest1.swift on lines 24..30

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

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 4 locations. Consider refactoring.
Open

switch character {
case "a", "e", "i", "o",
  "u"," ": continue
default: puzzleOutput.append(character)
}
src/test/swift/com/sleekbyte/tailor/functional/CommaWhitespaceTest.swift on lines 295..298
src/test/swift/com/sleekbyte/tailor/functional/CommaWhitespaceTest.swift on lines 300..303
src/test/swift/com/sleekbyte/tailor/grammar/ControlFlow.swift on lines 120..125

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

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

    private void verifyWillSetClauseBraceStyle(SwiftParser.WillSetClauseContext ctx) {
        Token left = ParseTreeUtil.getStopTokenForNode(ParseTreeUtil.getLeftSibling(ctx.codeBlock()));
        verifyCodeBlockOpenBraceStyle(ctx.codeBlock(), left, Messages.WILL_SET_CLAUSE);
        verifyBodyCloseBraceStyle(ctx.codeBlock(), Messages.WILL_SET_CLAUSE);
    }
src/main/java/com/sleekbyte/tailor/listeners/BraceStyleListener.java on lines 311..315

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

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

    private void verifyDidSetClauseBraceStyle(SwiftParser.DidSetClauseContext ctx) {
        Token left = ParseTreeUtil.getStopTokenForNode(ParseTreeUtil.getLeftSibling(ctx.codeBlock()));
        verifyCodeBlockOpenBraceStyle(ctx.codeBlock(), left, Messages.DID_SET_CLAUSE);
        verifyBodyCloseBraceStyle(ctx.codeBlock(), Messages.DID_SET_CLAUSE);
    }
src/main/java/com/sleekbyte/tailor/listeners/BraceStyleListener.java on lines 305..309

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

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 2 locations. Consider refactoring.
Open

    switch square + diceRoll {
    case finalSquare:
        // diceRoll will move us to the final square, so the game is over
        break gameLoop
    case let newSquare where newSquare > finalSquare:
Severity: Minor
Found in src/test/swift/com/sleekbyte/tailor/grammar/ControlFlow.swift and 1 other location - About 40 mins to fix
src/test/swift/com/sleekbyte/tailor/grammar/Protocols.swift on lines 85..93

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

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 2 locations. Consider refactoring.
Open

            switch square + diceRoll {
            case finalSquare:
                break gameLoop
            case let newSquare where newSquare > finalSquare:
                continue gameLoop
Severity: Minor
Found in src/test/swift/com/sleekbyte/tailor/grammar/Protocols.swift and 1 other location - About 40 mins to fix
src/test/swift/com/sleekbyte/tailor/grammar/ControlFlow.swift on lines 162..173

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

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 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 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
                        Severity
                        Category
                        Status
                        Source
                        Language