zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java

Summary

Maintainability
F
2 wks
Test Coverage

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

/* Configuration.java

    Purpose:
        
    Description:
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 4 days to fix

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

    public class Configuration {
        private static final Logger log = LoggerFactory.getLogger(Configuration.class);
    
        private static final String PROP_EXPRESS_FACTORY = "org.zkoss.xel.ExpressionFactory.class";
    
    
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 3 days to fix

      Method addListener has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
      Open

          public void addListener(Class<?> klass) throws Exception {
              boolean added = false;
              Object listener = null;
      
              if (Monitor.class.isAssignableFrom(klass)) {
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.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

      Method addListener has 152 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void addListener(Class<?> klass) throws Exception {
              boolean added = false;
              Object listener = null;
      
              if (Monitor.class.isAssignableFrom(klass)) {
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 6 hrs to fix

        Method getRichlet has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @SuppressWarnings("unchecked")
            public Richlet getRichlet(String name) {
                WaitLock lock = null;
                final Object[] info;
                for (;;) {
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr to fix

          Method getRichlet has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              @SuppressWarnings("unchecked")
              public Richlet getRichlet(String name) {
                  WaitLock lock = null;
                  final Object[] info;
                  for (;;) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr 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 removeListener has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public void removeListener(final Class<?> klass) {
                  if (_monitor != null && _monitor.getClass().equals(klass))
                      _monitor = null;
                  if (_pfmeter != null && _pfmeter.getClass().equals(klass))
                      _pfmeter = null;
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr to fix

            Method invokeEventThreadCompletes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public void invokeEventThreadCompletes(List<EventThreadCleanup> cleanups, Component comp, Event evt,
                        List<Throwable> errs, boolean silent) {
                    if (cleanups == null || cleanups.isEmpty())
                        return;
            
            
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr 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 newEventThreadCleanups has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public List<EventThreadCleanup> newEventThreadCleanups(Component comp, Event evt, List<Throwable> errs,
                        boolean silent) {
                    final Class<?>[] ary = _evtCleans.toArray();
                    if (ary.length == 0)
                        return null;
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr 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 removeRichlet0 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private Object removeRichlet0(String name) {
                    if (name == null) {
                        throw new IllegalArgumentException("Name is required");
                    }
                    Object o;
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr to fix

              Method removeRichlet0 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  private Object removeRichlet0(String name) {
                      if (name == null) {
                          throw new IllegalArgumentException("Name is required");
                      }
                      Object o;
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr 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 getErrorPage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public String getErrorPage(String deviceType, Throwable error) {
                      if (!_errpgs.isEmpty()) {
                          final List<ErrorPage> l;
                          synchronized (_errpgs) {
                              l = _errpgs.get(deviceType);
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr 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 removeListener has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void removeListener(final Class<?> klass) {
                      if (_monitor != null && _monitor.getClass().equals(klass))
                          _monitor = null;
                      if (_pfmeter != null && _pfmeter.getClass().equals(klass))
                          _pfmeter = null;
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.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 enableEventThread has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void enableEventThread(boolean enable) {
                      if (!enable && _wapp != null) {
                          final UiEngine engine = ((WebAppCtrl) _wapp).getUiEngine();
                          if (engine != null) {
                              if (engine.hasSuspendedThread())
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.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 invokeEventThreadCompletes has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public void invokeEventThreadCompletes(List<EventThreadCleanup> cleanups, Component comp, Event evt,
                          List<Throwable> errs, boolean silent) {
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 35 mins to fix

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

                    public boolean invokeEventThreadInits(List<EventThreadInit> inits, Component comp, Event evt) throws UiException {
                        if (inits == null || inits.isEmpty())
                            return true; //not to ignore
                
                        for (EventThreadInit fn : inits) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 35 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                    public Richlet getRichletByPath(String path) {
                        if (path == null || path.length() == 0 || "/".equals(path))
                            path = "";
                        else if (path.charAt(0) != '/')
                            path = '/' + path;
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 35 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                    private Object addRichlet0(String name, Object richletClass, Map<String, String> params) {
                        Object o;
                
                        for (;;) {
                            // remove previous richlet if it exists
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 35 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                    public String addErrorPage(String deviceType, Class<?> type, String location) {
                        if (!Throwable.class.isAssignableFrom(type))
                            throw new IllegalArgumentException("Throwable or derived is required: " + type);
                        if (location == null || deviceType == null)
                            throw new IllegalArgumentException();
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 35 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                    public void addDataHandler(DataHandlerInfo info) {
                        final String name = info.getName();
                        DataHandlerInfo old = _dataHandlers.put(name, info);
                        if (info.isOverride()) {
                            if (old == null)
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 25 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                    public void invokeExecutionCleanups(Execution exec, Execution parent, List<Throwable> errs) {
                        final Class<?>[] ary = _execCleans.toArray();
                        for (int j = 0; j < ary.length; ++j) {
                            try {
                                ((ExecutionCleanup) ary[j].newInstance()).cleanup(exec, parent, errs);
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.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

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

                    public List<EventThreadInit> newEventThreadInits(Component comp, Event evt) throws UiException {
                        final Class<?>[] ary = _evtInits.toArray();
                        if (ary.length == 0)
                            return null;
                
                
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 692..710

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

                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 List<EventThreadResume> newEventThreadResumes(Component comp, Event evt) throws UiException {
                        final Class<?>[] ary = _evtResus.toArray();
                        if (ary.length == 0)
                            return null;
                
                
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 484..502

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

                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 Initiator[] getInitiators() {
                        final Class<?>[] initclses = _initiators.toArray();
                        if (initclses.length == 0)
                            return new Initiator[0];
                
                
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1094..1108

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

                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 SEORenderer[] getSEORenderers() {
                        final Class<?>[] sdclses = _seoRends.toArray();
                        if (sdclses.length == 0)
                            return new SEORenderer[0];
                
                
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1049..1063

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

                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 void invokeSessionInits(Session sess, Object request) throws UiException {
                        final Class<?>[] ary = _sessInits.toArray();
                        for (int j = 0; j < ary.length; ++j) {
                            final Class<?> klass = ary[j];
                            try {
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 877..889

                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

                    public void invokeDesktopInits(Desktop desktop, Object request) throws UiException {
                        final Class<?>[] ary = _dtInits.toArray();
                        for (int j = 0; j < ary.length; ++j) {
                            final Class<?> klass = ary[j];
                            try {
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 825..837

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

                    public void afterShadowDetached(ShadowElement shadow, Component prevhost) {
                        final UiLifeCycle[] ary = _uiCycles.toArray();
                        for (int j = 0; j < ary.length; ++j) {
                            try {
                                ary[j].afterShadowDetached(shadow, prevhost);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1141..1150
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1156..1165
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1208..1217
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1253..1262
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1268..1277

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

                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

                    public void afterPageAttached(Page page, Desktop desktop) {
                        final UiLifeCycle[] ary = _uiCycles.toArray();
                        for (int j = 0; j < ary.length; ++j) {
                            try {
                                ary[j].afterPageAttached(page, desktop);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1141..1150
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1156..1165
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1208..1217
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1223..1232
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1268..1277

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

                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

                    public void afterComponentDetached(Component comp, Page prevpage) {
                        final UiLifeCycle[] ary = _uiCycles.toArray();
                        for (int j = 0; j < ary.length; ++j) {
                            try {
                                ary[j].afterComponentDetached(comp, prevpage);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1141..1150
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1208..1217
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1223..1232
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1253..1262
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1268..1277

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

                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

                    public void afterPageDetached(Page page, Desktop prevdesktop) {
                        final UiLifeCycle[] ary = _uiCycles.toArray();
                        for (int j = 0; j < ary.length; ++j) {
                            try {
                                ary[j].afterPageDetached(page, prevdesktop);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1141..1150
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1156..1165
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1208..1217
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1223..1232
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1253..1262

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

                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

                    public void afterComponentAttached(Component comp, Page page) {
                        final UiLifeCycle[] ary = _uiCycles.toArray();
                        for (int j = 0; j < ary.length; ++j) {
                            try {
                                ary[j].afterComponentAttached(comp, page);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1156..1165
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1208..1217
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1223..1232
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1253..1262
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1268..1277

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

                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

                    public void afterShadowAttached(ShadowElement shadow, Component host) {
                        final UiLifeCycle[] ary = _uiCycles.toArray();
                        for (int j = 0; j < ary.length; ++j) {
                            try {
                                ary[j].afterShadowAttached(shadow, host);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1141..1150
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1156..1165
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1223..1232
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1253..1262
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1268..1277

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

                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

                        if (AggregationListener.class.isAssignableFrom(klass)) {
                            try {
                                _aggregations.add((AggregationListener) (listener = getInstance(klass, listener)));
                            } catch (Throwable ex) {
                                log.error("Failed to instantiate " + klass, ex);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 50 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 358..365
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 366..373
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 374..381
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 382..389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 390..397

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

                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

                        if (RequestInterceptor.class.isAssignableFrom(klass)) {
                            try {
                                _reqIntcps.add((RequestInterceptor) (listener = getInstance(klass, listener)));
                            } catch (Throwable ex) {
                                log.error("Failed to instantiate " + klass, ex);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 50 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 349..356
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 358..365
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 374..381
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 382..389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 390..397

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

                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

                        if (UiLifeCycle.class.isAssignableFrom(klass)) {
                            try {
                                _uiCycles.add((UiLifeCycle) (listener = getInstance(klass, listener)));
                            } catch (Throwable ex) {
                                log.error("Failed to instantiate " + klass, ex);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 50 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 349..356
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 358..365
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 366..373
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 374..381
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 390..397

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

                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

                        if (URIInterceptor.class.isAssignableFrom(klass)) {
                            try {
                                _uriIntcps.add((URIInterceptor) (listener = getInstance(klass, listener)));
                            } catch (Throwable ex) {
                                log.error("Failed to instantiate " + klass, ex);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 50 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 349..356
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 366..373
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 374..381
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 382..389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 390..397

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

                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

                        if (EventInterceptor.class.isAssignableFrom(klass)) {
                            try {
                                _eis.addEventInterceptor((EventInterceptor) (listener = getInstance(klass, listener)));
                            } catch (Throwable ex) {
                                log.error("Failed to instantiate " + klass, ex);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 50 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 349..356
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 358..365
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 366..373
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 382..389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 390..397

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

                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

                        if (PropertiesRenderer.class.isAssignableFrom(klass)) {
                            try {
                                _propRends.add((PropertiesRenderer) (listener = getInstance(klass, listener)));
                            } catch (Throwable ex) {
                                log.error("Failed to instantiate " + klass, ex);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 50 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 349..356
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 358..365
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 366..373
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 374..381
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 382..389

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

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

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

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

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

                Refactorings

                Further Reading

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

                        if (Monitor.class.isAssignableFrom(klass)) {
                            if (_monitor != null)
                                throw new UiException(onlyOnce(Monitor.class));
                            _monitor = (Monitor) (listener = getInstance(klass, listener));
                            added = true;
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 3 other locations - About 45 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 258..263
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 264..269
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 270..275

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

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

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

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

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

                Refactorings

                Further Reading

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

                        if (DesktopRecycle.class.isAssignableFrom(klass)) {
                            if (_dtRecycle != null)
                                throw new UiException(onlyOnce(DesktopRecycle.class));
                            _dtRecycle = (DesktopRecycle) (listener = getInstance(klass, listener));
                            added = true;
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 3 other locations - About 45 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 252..257
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 258..263
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 264..269

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

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

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

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

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

                Refactorings

                Further Reading

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

                        if (PerformanceMeter.class.isAssignableFrom(klass)) {
                            if (_pfmeter != null)
                                throw new UiException(onlyOnce(PerformanceMeter.class));
                            _pfmeter = (PerformanceMeter) (listener = getInstance(klass, listener));
                            added = true;
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 3 other locations - About 45 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 252..257
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 264..269
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 270..275

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

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

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

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

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

                Refactorings

                Further Reading

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

                        if (ExecutionMonitor.class.isAssignableFrom(klass)) {
                            if (_execmon != null)
                                throw new UiException(onlyOnce(ExecutionMonitor.class));
                            _execmon = (ExecutionMonitor) (listener = getInstance(klass, listener));
                            added = true;
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 3 other locations - About 45 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 252..257
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 258..263
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 270..275

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

                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 String removeClientErrorReload(String deviceType, int errCode, String connType) {
                        final String index = deviceConn2Str(deviceType, connType);
                        synchronized (_errURIs) {
                            Map<Integer, String> map = _errURIs.get(index);
                            return map != null ? map.remove(errCode) : null;
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 45 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 2009..2015

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

                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 String getClientErrorReload(String deviceType, int errCode, String connType) {
                        final String index = deviceConn2Str(deviceType, connType);
                        synchronized (_errURIs) {
                            Map<Integer, String> map = _errURIs.get(index);
                            return map != null ? map.get(errCode) : null;
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 45 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1991..1997

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

                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 (!lock.waitUntilUnlock(300 * 1000)) { //5 minute
                                final PotentialDeadLockException ex = new PotentialDeadLockException(
                                        "Unable to load richlet " + name + "\nCause: conflict too long.");
                                log.warn("", ex); //very rare, possibly a bug
                                throw ex;
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 40 mins to fix
                zcommon/src/main/java/org/zkoss/util/resource/ResourceCache.java on lines 122..128

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

                    public void setUiEngineClass(Class<?> cls) {
                        if (cls != null && !UiEngine.class.isAssignableFrom(cls))
                            throw new IllegalArgumentException("UiEngine not implemented: " + cls);
                        _uiengcls = cls;
                    }
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1429..1433
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1452..1456
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1473..1477
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1494..1498
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1516..1520
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1539..1543
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1560..1564
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1583..1587

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

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

                    public void setFileItemFactoryClass(Class<?> cls) {
                        if (cls != null && !DiskFileItemFactory.class.isAssignableFrom(cls))
                            throw new IllegalArgumentException("DiskFileItemFactory not implemented: " + cls);
                        _fileFactory = cls;
                    }
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1385..1389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1429..1433
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1452..1456
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1473..1477
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1494..1498
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1516..1520
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1539..1543
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1583..1587

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

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

                    public void setDesktopCacheProviderClass(Class<?> cls) {
                        if (cls != null && !DesktopCacheProvider.class.isAssignableFrom(cls))
                            throw new IllegalArgumentException("DesktopCacheProvider not implemented: " + cls);
                        _dcpcls = cls;
                    }
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1385..1389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1429..1433
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1473..1477
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1494..1498
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1516..1520
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1539..1543
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1560..1564
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1583..1587

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

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

                    public void setUiFactoryClass(Class<?> cls) {
                        if (cls != null && !UiFactory.class.isAssignableFrom(cls))
                            throw new IllegalArgumentException("UiFactory not implemented: " + cls);
                        _uiftycls = cls;
                    }
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1385..1389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1429..1433
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1452..1456
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1494..1498
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1516..1520
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1539..1543
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1560..1564
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1583..1587

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

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

                    public void setWebAppFactoryClass(Class<?> cls) {
                        if (cls != null && !WebAppFactory.class.isAssignableFrom(cls))
                            throw new IllegalArgumentException("WebAppFactory not implemented: " + cls);
                        _wappftycls = cls;
                    }
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1385..1389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1452..1456
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1473..1477
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1494..1498
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1516..1520
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1539..1543
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1560..1564
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1583..1587

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

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

                    public void setFailoverManagerClass(Class<?> cls) {
                        if (cls != null && !FailoverManager.class.isAssignableFrom(cls))
                            throw new IllegalArgumentException("FailoverManager not implemented: " + cls);
                        _failmancls = cls;
                    }
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1385..1389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1429..1433
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1452..1456
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1473..1477
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1516..1520
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1539..1543
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1560..1564
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1583..1587

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

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

                    public void setAuDecoderClass(Class<?> cls) {
                        if (cls != null && !AuDecoder.class.isAssignableFrom(cls))
                            throw new IllegalArgumentException("AuDecoder not implemented: " + cls);
                        _audeccls = cls;
                    }
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1385..1389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1429..1433
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1452..1456
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1473..1477
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1494..1498
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1516..1520
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1539..1543
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1560..1564

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

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

                    public void setIdGeneratorClass(Class<?> cls) {
                        if (cls != null && !IdGenerator.class.isAssignableFrom(cls))
                            throw new IllegalArgumentException("IdGenerator not implemented: " + cls);
                        _idgencls = cls;
                    }
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1385..1389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1429..1433
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1452..1456
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1473..1477
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1494..1498
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1539..1543
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1560..1564
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1583..1587

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

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

                    public void setSessionCacheClass(Class<?> cls) {
                        if (cls != null && !SessionCache.class.isAssignableFrom(cls))
                            throw new IllegalArgumentException("SessionCache not implemented: " + cls);
                        _sesscachecls = cls;
                    }
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1385..1389
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1429..1433
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1452..1456
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1473..1477
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1494..1498
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1516..1520
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1560..1564
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1583..1587

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

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

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

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

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

                Refactorings

                Further Reading

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

                            } catch (Throwable ex) {
                                if (errs != null)
                                    errs.add(ex);
                                if (!silent)
                                    log.error("Failed to invoke " + fn, ex);
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 30 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 569..574

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

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

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

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

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

                Refactorings

                Further Reading

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

                            } catch (Throwable t) {
                                if (errs != null)
                                    errs.add(t);
                                if (!silent)
                                    log.error("Failed to invoke " + klass, t);
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 30 mins to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 603..608

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

                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