prowide/prowide-core

View on GitHub
src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java

Summary

Maintainability
F
1 wk
Test Coverage

File SwiftTagListBlockTest.java has 1422 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright 2006-2023 Prowide
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.

    SwiftTagListBlockTest has 97 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class SwiftTagListBlockTest {
    
        private SwiftTagListBlock b;
        private Tag t;
    
    

      Method testGetSubBlockMT564 has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @Test
          public void testGetSubBlockMT564() {
              final String msg =
                      "{1:F01MTGSUS6SAXXX3206837054}{2:O5641435070316CHASGB2LDGST07128160300703160735N}{3:{108:000255CQ8272245}}{4:\n"
                              + ":16R:GENL\n"

        Method testGetSubBlocksByTagNames has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Test
            public void testGetSubBlocksByTagNames() {
                /*
                 * empty search and empty block
                 */

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

              @Test
              public void testGetSubBlockByTagNames() {
                  /*
                   * empty search and empty block
                   */

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

                @Test
                public void testgetSubBlock08() {
                    b.append(new Tag("99:foo"));
                    b.append(new Tag("16R:blockname"));
                    b.append(new Tag("2:val2"));

              Method testgetSubBlock09 has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @Test
                  public void testgetSubBlock09() {
                      b.append(new Tag("99:foo"));
                      b.append(new Tag("16R:blockname"));
                      b.append(new Tag("2:val2"));

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

                    @Test
                    public void testSplitByTagName() {
                        b.append(new Tag("20:foo"));
                        b.append(new Tag("21:foo"));
                        assertTrue(b.splitByTagName(22, null).isEmpty());

                  Method testgetSubBlock07 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Test
                      public void testgetSubBlock07() {
                          b.append(new Tag("99:foo"));
                          b.append(new Tag("16R:blockname"));
                          b.append(new Tag("2:val2"));

                    Method testgetSubBlock10b has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @Test
                        public void testgetSubBlock10b() {
                            b.append(new Tag("99:foo"));
                            b.append(new Tag("1:start"));
                            b.append(new Tag("2:val2"));

                      Method testgetSubBlock06 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          @Test
                          public void testgetSubBlock06() {
                              b.append(new Tag("99:foo"));
                              b.append(new Tag("1:start"));
                              b.append(new Tag("2:val2"));

                        Method testgetSubBlock10 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            @Test
                            public void testgetSubBlock10() {
                                b.append(new Tag("99:foo"));
                                b.append(new Tag("1:start"));
                                b.append(new Tag("2:val2"));

                          Define a constant instead of duplicating this literal "a:val1" 3 times.
                          Open

                                  b.append(new Tag("a:val1"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "after" 4 times.
                          Open

                                  b.append(Field20.tag("after"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "blockname" 14 times.
                          Open

                                  List<SwiftTagListBlock> sbs = b.getSubBlocks("blockname");

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "8:val8" 14 times.
                          Open

                                  SwiftTagListBlock sb = b.getSubBlock(new Tag("7:val7"), new Tag("8:val8"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "77:foo" 8 times.
                          Open

                                  b.append(new Tag("77:foo"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "b:val1" 3 times.
                          Open

                                  b.append(new Tag("b:val1"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "4:val4" 37 times.
                          Open

                                  b.append(new Tag("4:val4"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "c:val3" 3 times.
                          Open

                                  b.append(new Tag("c:val3"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal ":98A::PAYD//20111111 " 3 times.
                          Open

                                                  + ":98A::PAYD//20111111\n"

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "before" 4 times.
                          Open

                                  b.append(Field20.tag("before"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "1:val2" 5 times.
                          Open

                                  b.append(new Tag("1:val2"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "3:end" 8 times.
                          Open

                                  b.append(new Tag("3:end"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "3K:val6" 12 times.
                          Open

                                  b.append(new Tag("3K:val6"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "16R:foo" 4 times.
                          Open

                                  b.append(new Tag("16R:foo"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "3:val3" 12 times.
                          Open

                                  b.append(new Tag("3:val3"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "88:foo" 8 times.
                          Open

                                  b.append(new Tag("88:foo"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "second block" 3 times.
                          Open

                                  b.append(Field20.tag("second block"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "SUBBAL" 12 times.
                          Open

                                  b.append(Field16R.tag("SUBBAL"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "16S:TEST" 3 times.
                          Open

                                  b.append(new Tag("16S:TEST"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "5:val5" 37 times.
                          Open

                                  b.append(new Tag("5:val5"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "16R:blockname" 6 times.
                          Open

                                  b.append(new Tag("16R:blockname"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "16S:foo" 4 times.
                          Open

                                  b.append(new Tag("16S:foo"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "3K:val3" 30 times.
                          Open

                                  b.append(new Tag("3K:val3"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "2:val2" 49 times.
                          Open

                                  b.append(new Tag("2:val2"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "1:start" 10 times.
                          Open

                                  b.append(new Tag("1:start"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "start" 6 times.
                          Open

                                  assertEquals("start", sb.getTag(0).getValue());

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "16S:blockname" 5 times.
                          Open

                                  b.append(new Tag("16S:blockname"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "7:val7" 14 times.
                          Open

                                  SwiftTagListBlock sb = b.getSubBlock(new Tag("7:val7"), new Tag("8:val8"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "1:val1" 49 times.
                          Open

                                  Tag t = new Tag("1:val1");

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "16R:TEST" 3 times.
                          Open

                                  b.append(new Tag("16R:TEST"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

                          Define a constant instead of duplicating this literal "99:foo" 8 times.
                          Open

                                  b.append(new Tag("99:foo"));

                          Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                          On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                          Noncompliant Code Example

                          With the default threshold of 3:

                          public void run() {
                            prepare("action1");                              // Noncompliant - "action1" is duplicated 3 times
                            execute("action1");
                            release("action1");
                          }
                          
                          @SuppressWarning("all")                            // Compliant - annotations are excluded
                          private void method1() { /* ... */ }
                          @SuppressWarning("all")
                          private void method2() { /* ... */ }
                          
                          public String method3(String a) {
                            System.out.println("'" + a + "'");               // Compliant - literal "'" has less than 5 characters and is excluded
                            return "";                                       // Compliant - literal "" has less than 5 characters and is excluded
                          }
                          

                          Compliant Solution

                          private static final String ACTION_1 = "action1";  // Compliant
                          
                          public void run() {
                            prepare(ACTION_1);                               // Compliant
                            execute(ACTION_1);
                            release(ACTION_1);
                          }
                          

                          Exceptions

                          To prevent generating some false-positives, literals having less than 5 characters are excluded.

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

                                  final String msg =
                                          "{1:F01MTGSUS6SAXXX3206837054}{2:O5641435070316CHASGB2LDGST07128160300703160735N}{3:{108:000255CQ8272245}}{4:\n"
                                                  + ":16R:GENL\n"
                                                  + ":20C::CORP//D455103\n"
                                                  + ":20C::SEME//029206016\n"
                          src/test/java/com/prowidesoftware/swift/io/parser/MT564ParserTest.java on lines 34..81
                          src/test/java/com/prowidesoftware/swift/io/parser/SystemMessageTest.java on lines 132..179

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

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

                              @Test
                              public void testRemoveSubBlock() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1379..1393
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1395..1409

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

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

                              @Test
                              public void testRemoveSubBlock_3() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("16R:HELLO"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1363..1377
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1379..1393

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

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

                              @Test
                              public void testRemoveSubBlock_2() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1363..1377
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1395..1409

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

                          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 testTagsByNameBeing() {
                                  b.append(new Tag("95C", "foo"));
                                  assertEquals(1, b.getTagsByName("95a", "foo").size());
                          
                          
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 746..760

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

                          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 testFieldsByNameBeing() {
                                  b.append(new Tag("95C", "foo"));
                                  assertEquals(1, b.getFieldsByName("95a", "foo").size());
                          
                          
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 762..776

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

                          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 testGetSubBlockBeforeFirstFirst2() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 817..831

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

                          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 testGetSubBlockAfterFirst3() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 977..991

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

                          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 testGetSubBlockBeforeLast() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 934..948

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

                          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 testGetSubBlockAfterLast() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 903..917

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

                          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 testGetSubBlockDelimitedWithOptionalTail_06() {
                                  appends(b, 1, 9);
                          
                                  String[] start = {"2"};
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1213..1227

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

                          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 testGetSubBlockDelimitedWithOptionalTail_02() {
                                  appends(b, 1, 9);
                          
                                  String[] start = {"1"};
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1276..1290

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

                          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 testgetTagsByValue() {
                                  b.append(new Tag("a:val1"));
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("1:val2"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 245..258

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

                          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 testgetTagsByContent() {
                                  b.append(new Tag("a:val1aaa"));
                                  b.append(new Tag("1:dddval1"));
                                  b.append(new Tag("1:val2"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 230..243

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

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

                              @Test
                              public void testGetSubBlockBeforeFirstLimit2() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 833..845
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 847..859
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 861..873
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 993..1005
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1021..1033

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

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

                              @Test
                              public void testGetSubBlockAfterFirstNotFound() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 833..845
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 847..859
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 993..1005
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1007..1019
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1021..1033

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

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

                              @Test
                              public void testGetSubBlockAfterFirstLimit() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 847..859
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 861..873
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 993..1005
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1007..1019
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1021..1033

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

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

                              @Test
                              public void testGetSubBlockAfterFirstLimit2() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 833..845
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 861..873
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 993..1005
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1007..1019
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1021..1033

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

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

                              @Test
                              public void testGetSubBlockBeforeFirstLimit() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 833..845
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 847..859
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 861..873
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1007..1019
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1021..1033

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

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

                              @Test
                              public void testGetSubBlockBeforeFirstNotFound() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 833..845
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 847..859
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 861..873
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 993..1005
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1007..1019

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

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

                              @Test
                              public void testGetSubBlockBeforeFirst2() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 791..802
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 804..815

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

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

                              @Test
                              public void testGetSubBlockAfterFirst() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 804..815
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 950..961

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

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

                              @Test
                              public void testGetSubBlockAfterFirst2() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("2:val2"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 791..802
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 950..961

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

                          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 testRemoveSubBlock_5() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("16R:TEST"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1436..1446

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

                          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 testRemoveSubBlock_6() {
                                  b.append(new Tag("1:val1"));
                                  b.append(new Tag("16R:TEST"));
                                  b.append(new Tag("3K:val3"));
                          src/test/java/com/prowidesoftware/swift/model/SwiftTagListBlockTest.java on lines 1424..1434

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

                          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

                          There are no issues that match your filters.

                          Category
                          Status