zk/src/main/java/org/zkoss/zk/ui/Components.java

Summary

Maintainability
F
1 wk
Test Coverage

Exec has 100 methods (exceeds 20 allowed). Consider refactoring.
Open

    private static class Exec implements Execution {
        private static final Execution exec() {
            return Executions.getCurrent();
        }

Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 1 day to fix

    File Components.java has 743 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* Components.java
    
        Purpose:
            
        Description:
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 1 day to fix

      Method getImplicit has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
      Open

          public static Object getImplicit(Page page, Component comp, String name) {
              if (comp != null && page == null)
                  page = getCurrentPage(comp);
      
              if ("log".equals(name))
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Components has 33 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class Components {
          private static final Logger _zklog = LoggerFactory.getLogger("org.zkoss.zk.log");
      
          protected Components() {
          }
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 4 hrs to fix

        Method componentToPath has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

            public static final String componentToPath(Component comp, Component ref) {
                //Implementation Note:
                //The path being written is a bit different to Path, if ref
                //is not an space owner
                //For example, if comp is the space owner, "" is written.
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method getVisibleChildren has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

            public static Collection<Component> getVisibleChildren(Component comp) {
                final Collection<Component> children = comp.getChildren();
                return new AbstractCollection<Component>() {
                    public int size() {
                        int size = 0;
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method getImplicit has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static Object getImplicit(Page page, Component comp, String name) {
                if (comp != null && page == null)
                    page = getCurrentPage(comp);
        
                if ("log".equals(name))
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 2 hrs to fix

          Method sort has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              public static void sort(List<? extends Component> list, int from, int to, Comparator<? super Component> cpr) {
                  final Component[] ary = CollectionsX.toArray(list, new Component[0], from, to);
                  Arrays.sort(ary, cpr);
          
                  ListIterator<? extends Component> it = list.listIterator(from);
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method getVisibleChildren has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static Collection<Component> getVisibleChildren(Component comp) {
                  final Collection<Component> children = comp.getChildren();
                  return new AbstractCollection<Component>() {
                      public int size() {
                          int size = 0;
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 1 hr to fix

            Method componentToPath has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static final String componentToPath(Component comp, Component ref) {
                    //Implementation Note:
                    //The path being written is a bit different to Path, if ref
                    //is not an space owner
                    //For example, if comp is the space owner, "" is written.
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 1 hr to fix

              Method iterator has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                          public Iterator<Component> iterator() {
                              return new Iterator<Component>() {
                                  final Iterator<Component> _it = children.iterator();
                                  Component _next;
              
              
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 55 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method getComposer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static Composer getComposer(Component comp) {
                      if (comp != null) {
                          Object onm = comp.getAttribute("composerName");
                          if (onm instanceof String && ((String) onm).length() > 0) {
                              return (Composer) comp.getAttribute((String) onm);
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 45 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                      public Component createComponentsDirectly(Document content, String extension, Component parent,
                              Component insertBefore, VariableResolver resolver) {
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 35 mins to fix

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

                        public Component createComponentsDirectly(String content, String extension, Component parent,
                                Component insertBefore, VariableResolver resolver) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 35 mins to fix

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

                          public Component createComponentsDirectly(Reader reader, String extension, Component parent,
                                  Component insertBefore, VariableResolver resolver) throws IOException {
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 35 mins to fix

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

                            public Component[] createComponents(String uri, Component parent, Component insertBefore,
                                    VariableResolver resolver, Map<?, ?> arg) {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 35 mins to fix

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

                          public static final int getScope(String scope) {
                              if ("component".equals(scope))
                                  return Component.COMPONENT_SCOPE;
                              if ("space".equals(scope))
                                  return Component.SPACE_SCOPE;
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 35 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Avoid too many return statements within this method.
                      Open

                                  return app != null ? app.getAttributes() : Collections.EMPTY_MAP;
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return EXECUTION_PROXY;
                        Severity: Major
                        Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return Component.SESSION_SCOPE;
                          Severity: Major
                          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return comp != null ? getDesktop(comp) : page.getDesktop();
                            Severity: Major
                            Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return exec != null ? exec.getArg() : null;
                              Severity: Major
                              Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return scope != null ? scope.getAttributes() : Collections.EMPTY_MAP;
                                Severity: Major
                                Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return sess != null ? sess.getAttributes() : Collections.EMPTY_MAP;
                                  Severity: Major
                                  Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return exec != null ? exec.getParameterMap() : null;
                                    Severity: Major
                                    Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                  return Component.APPLICATION_SCOPE;
                                      Severity: Major
                                      Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return exec != null ? exec.getAttributes() : Collections.EMPTY_MAP;
                                        Severity: Major
                                        Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                  return null;
                                          Severity: Major
                                          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                        return comp != null ? comp.getAttributes() : Collections.EMPTY_MAP;
                                            Severity: Major
                                            Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                          return REQUEST_SCOPE_PROXY;
                                              Severity: Major
                                              Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                            return comp != null ? getSession(comp) : page.getDesktop().getSession();
                                                Severity: Major
                                                Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                              return page != null ? page.getAttributes() : Collections.EMPTY_MAP;
                                                  Severity: Major
                                                  Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                return dt != null ? dt.getAttributes() : Collections.EMPTY_MAP;
                                                    Severity: Major
                                                    Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                  return comp != null ? getWebApp(comp) : page.getDesktop().getWebApp();
                                                      Severity: Major
                                                      Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                    return Component.REQUEST_SCOPE;
                                                        Severity: Major
                                                        Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 30 mins to fix

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

                                                              public static void replace(Component oldc, Component newc) {
                                                                  final Component p = oldc.getParent(), sib = oldc.getNextSibling();
                                                                  if (p != null) {
                                                                      oldc.detach();
                                                                      p.insertBefore(newc, sib);
                                                          Severity: Minor
                                                          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 25 mins to fix

                                                          Cognitive Complexity

                                                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                          A method's cognitive complexity is based on a few simple rules:

                                                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                          • Code is considered more complex for each "break in the linear flow of the code"
                                                          • Code is considered more complex when "flow breaking structures are nested"

                                                          Further reading

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

                                                              public static Page getCurrentPage(Component comp) {
                                                                  if (comp != null) {
                                                                      Page page = comp.getPage();
                                                                      if (page != null)
                                                                          return page;
                                                          Severity: Minor
                                                          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java and 1 other location - About 55 mins to fix
                                                          zk/src/main/java/org/zkoss/zk/ui/select/SelectorComposer.java on lines 132..140

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

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

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

                                                                  if ("sessionScope".equals(name)) {
                                                                      final Session sess = comp != null ? getSession(comp) : page.getDesktop().getSession();
                                                                      return sess != null ? sess.getAttributes() : Collections.EMPTY_MAP;
                                                                  }
                                                          Severity: Minor
                                                          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java and 1 other location - About 40 mins to fix
                                                          zk/src/main/java/org/zkoss/zk/ui/Components.java on lines 488..491

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

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

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

                                                                  if ("applicationScope".equals(name)) {
                                                                      final WebApp app = comp != null ? getWebApp(comp) : page.getDesktop().getWebApp();
                                                                      return app != null ? app.getAttributes() : Collections.EMPTY_MAP;
                                                                  }
                                                          Severity: Minor
                                                          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java and 1 other location - About 40 mins to fix
                                                          zk/src/main/java/org/zkoss/zk/ui/Components.java on lines 484..487

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

                                                          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

                                                                  public boolean equals(Object o) {
                                                                      if (this == o)
                                                                          return true;
                                                                      if (o instanceof Exec)
                                                                          return Objects.equals(exec(), ((Exec) o).exec());
                                                          Severity: Minor
                                                          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java and 1 other location - About 40 mins to fix
                                                          zk/src/main/java/org/zkoss/zk/ui/Components.java on lines 1087..1093

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 48.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

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

                                                                  public boolean equals(Object o) {
                                                                      if (this == o)
                                                                          return true;
                                                                      if (o instanceof RequestScope)
                                                                          return Objects.equals(req(), ((RequestScope) o).req());
                                                          Severity: Minor
                                                          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java and 1 other location - About 40 mins to fix
                                                          zk/src/main/java/org/zkoss/zk/ui/Components.java on lines 1007..1013

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 48.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

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

                                                                  final String[] names = { "application", "applicationScope", "arg", "componentScope", "desktop", "desktopScope",
                                                                          "execution", "event", //since 3.6.1, #bug 2681819: normal page throws exception after installed zkspring
                                                                          "self", "session", "sessionScope", "spaceOwner", "spaceScope", "page", "pageScope", "requestScope",
                                                                          "param" };
                                                          Severity: Minor
                                                          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java and 1 other location - About 30 mins to fix
                                                          zcommon/src/main/java/org/zkoss/html/HTMLs.java on lines 203..208

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

                                                          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