Showing 7,775 of 7,775 total issues

Function ajaxHandleResponses has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ajaxHandleResponses( s, jqXHR, responses ) {

    var ct, type, finalDataType, firstDataType,
        contents = s.contents,
        dataTypes = s.dataTypes;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

    Function window$mold$ has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function window$mold$(out, skipper) {
        var uuid = this.uuid,
            title = this.getTitle(),
            caption = this.caption,
            contentStyleHTML = zUtl.encodeXML(this.getContentStyle()),
    Severity: Minor
    Found in zul/src/main/resources/web/js/zul/wnd/mold/window.js - About 1 hr to fix

      Function checkOverflow has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function checkOverflow(m) {
              var overflow,
                  a = m._a;
      
              if (a && getParsingFlags(m).overflow === -2) {
      Severity: Minor
      Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

        Function as has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function as(units) {
                if (!this.isValid()) {
                    return NaN;
                }
                var days,
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

          Function encodeXML has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  static encodeXML(txt: string | null, opts?: EncodeXmlOptions): string {
                      txt = txt != null ? String(txt) : '';
          
                      if (!opts) // speed up the replacement.
                          return _encodeXML0(txt);
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/utl.ts - About 1 hr to fix

            Function slideDown has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    slideDown(wgt: zk.Widget, opts?: zk.SlideOptions): this {
                        if (_checkAnimated(this, wgt, opts, 'slideDown'))
                            return this;
            
                        var anchor = opts ? opts.anchor || 't' : 't',
            Severity: Minor
            Found in zk/src/main/resources/web/js/zk/anima.ts - About 1 hr to fix

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

                      } else if (LoadInfo.TYPE.equals(type)) {
                          if (info.containsKey("condition")) {
                              sb.append("[" + info.get("condition") + "]\t");
                          }
                          sb.append(info.get("fromExpr") + " > " + info.get("toExpr") + "\t");
              zkbind/src/main/java/org/zkoss/bind/sys/debugger/impl/DefaultExecutionInfoCollector.java on lines 103..113

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

              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

                      } else if (SaveInfo.TYPE.equals(type)) {
                          if (info.containsKey("condition")) {
                              sb.append("[" + info.get("condition") + "]\t");
                          }
                          sb.append(info.get("fromExpr") + " > " + info.get("toExpr") + "\t");
              zkbind/src/main/java/org/zkoss/bind/sys/debugger/impl/DefaultExecutionInfoCollector.java on lines 82..93

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 98.

              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 addOnActivate(Callback callback) {
                      Execution exec = Executions.getCurrent();
                      if (exec == null)
                          throw new IllegalStateException("Execution cannot be null!");
                      Desktop desktop = exec.getDesktop();
              zk/src/main/java/org/zkoss/zk/ui/impl/AbstractExecution.java on lines 600..613

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

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

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

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

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

              Refactorings

              Further Reading

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

                private static int zzUnpackAttribute(String packed, int offset, int [] result) {
                  int i = 0;       /* index in packed string  */
                  int j = offset;  /* index in unpacked array */
                  int l = packed.length();
                  while (i < l) {
              Severity: Major
              Found in zcommon/src/main/java/org/zkoss/json/parser/Yylex.java and 1 other location - About 1 hr to fix
              zcommon/src/main/java/org/zkoss/json/parser/Yylex.java on lines 61..71

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

              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 setParent(Component parent) {
                      final Component oldp = getParent();
                      if (oldp == parent)
                          return; //nothing changed
              
              
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Treeitem.java and 1 other location - About 1 hr to fix
              zul/src/main/java/org/zkoss/zul/Treechildren.java on lines 206..223

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

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

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

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

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

              Refactorings

              Further Reading

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

                  public void checkViewModel(Component comp) {
                      final ComponentCtrl compCtrl = (ComponentCtrl) comp;
              
                      for (Annotation anno : compCtrl.getAnnotations(VIEW_MODEL_ATTR)) {
                          String nm = anno.getName();
              zkbind/src/main/java/org/zkoss/bind/sys/debugger/impl/DefaultAnnotationInfoChecker.java on lines 128..142
              zkbind/src/main/java/org/zkoss/bind/sys/debugger/impl/DefaultAnnotationInfoChecker.java on lines 144..159

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

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

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

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

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

              Refactorings

              Further Reading

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

                  public void checkValidationMessages(Component comp) {
                      final ComponentCtrl compCtrl = (ComponentCtrl) comp;
                      for (Annotation anno : compCtrl.getAnnotations(VALIDATION_MESSAGES_ATTR)) {
                          String nm = anno.getName();
                          if (ID_ANNO.equals(nm) || INIT_ANNO.equals(nm)) {
              zkbind/src/main/java/org/zkoss/bind/sys/debugger/impl/DefaultAnnotationInfoChecker.java on lines 110..126
              zkbind/src/main/java/org/zkoss/bind/sys/debugger/impl/DefaultAnnotationInfoChecker.java on lines 128..142

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

              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 setParent(Component parent) {
                      final Component oldp = getParent();
                      if (oldp == parent)
                          return; //nothing changed
              
              
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Treechildren.java and 1 other location - About 1 hr to fix
              zul/src/main/java/org/zkoss/zul/Treeitem.java on lines 471..487

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 98.

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

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

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

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

              Refactorings

              Further Reading

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

                  public void checkBinder(Component comp) {
                      final ComponentCtrl compCtrl = (ComponentCtrl) comp;
                      for (Annotation anno : compCtrl.getAnnotations(BINDER_ATTR)) {
                          String nm = anno.getName();
                          if (ID_ANNO.equals(nm) || INIT_ANNO.equals(nm)) {
              zkbind/src/main/java/org/zkoss/bind/sys/debugger/impl/DefaultAnnotationInfoChecker.java on lines 110..126
              zkbind/src/main/java/org/zkoss/bind/sys/debugger/impl/DefaultAnnotationInfoChecker.java on lines 144..159

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

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

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

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

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

              Refactorings

              Further Reading

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

                private static int zzUnpackAction(String packed, int offset, int [] result) {
                  int i = 0;       /* index in packed string  */
                  int j = offset;  /* index in unpacked array */
                  int l = packed.length();
                  while (i < l) {
              Severity: Major
              Found in zcommon/src/main/java/org/zkoss/json/parser/Yylex.java and 1 other location - About 1 hr to fix
              zcommon/src/main/java/org/zkoss/json/parser/Yylex.java on lines 208..218

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

              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 addOnDeactivate(Callback callback) {
                      Execution exec = Executions.getCurrent();
                      if (exec == null)
                          throw new IllegalStateException("Execution cannot be null!");
                      Desktop desktop = exec.getDesktop();
              zk/src/main/java/org/zkoss/zk/ui/impl/AbstractExecution.java on lines 579..592

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

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

                final public void String() throws ParseException {
                                       /*@bgen(jjtree) String */
                                        AstString jjtn000 = new AstString(JJTSTRING);
                                        boolean jjtc000 = true;
                                        jjtree.openNodeScope(jjtn000);Token t = null;
              Severity: Major
              Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 4 other locations - About 1 hr to fix
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 86..101
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1808..1823
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1955..1970
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1976..1991

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

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

                final public void Integer() throws ParseException {
                                         /*@bgen(jjtree) Integer */
                                          AstInteger jjtn000 = new AstInteger(JJTINTEGER);
                                          boolean jjtc000 = true;
                                          jjtree.openNodeScope(jjtn000);Token t = null;
              Severity: Major
              Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 4 other locations - About 1 hr to fix
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 86..101
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1808..1823
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1955..1970
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1997..2012

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

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

                final public void Identifier() throws ParseException {
                                               /*@bgen(jjtree) Identifier */
                                                AstIdentifier jjtn000 = new AstIdentifier(JJTIDENTIFIER);
                                                boolean jjtc000 = true;
                                                jjtree.openNodeScope(jjtn000);Token t = null;
              Severity: Major
              Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 4 other locations - About 1 hr to fix
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 86..101
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1955..1970
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1976..1991
              zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1997..2012

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

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

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

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

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

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language