Showing 7,775 of 7,775 total issues

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

    private void onListDataChange(ListDataEvent event) {
        int type = event.getType();
        // ZK-4549: should ignore before handling sorting
        if (getAttribute(Attributes.BEFORE_MODEL_ITEMS_RENDERED) != null
                && (type == ListDataEvent.INTERVAL_ADDED || type == ListDataEvent.INTERVAL_REMOVED))
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.java - About 1 hr to fix

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

        private void renderChildren0(Renderer renderer, Treechildren parent, Treeitem ti, Object childNode, int i)
                throws Throwable {
            renderer.render(ti, childNode, i);
            Object v = ti.getAttribute(Attributes.MODEL_RENDERAS);
            if (v != null) { //a new item is created to replace the existent one
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 1 hr to fix

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

          /**/ boolean doSort(boolean ascending) {
              final Comparator cmpr = ascending ? _sortAsc : _sortDsc;
              if (cmpr == null)
                  return false;
      
      
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Listheader.java - About 1 hr to fix

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

            private static int parseAttrs(Context ctx, Map<String, String> attrs, String actnm, int from, int to)
                    throws DspException {
                for (int j, k = from;;) {
                    j = skipWhitespaces(ctx, k, to);
                    k = nextSeparator(ctx, j, to);
        Severity: Minor
        Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 1 hr to fix

          Function mightThrow has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                                          mightThrow = function() {
                                              var returned, then;
          
                                              // Support: Promises/A+ section 2.3.3.3.3
                                              // https://promisesaplus.com/#point-59
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

            Function apportion has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function apportion(node, previousSibling, ancestor) {
                  if (previousSibling) {
                    var vip = node,
                        vop = node,
                        vim = previousSibling,
            Severity: Minor
            Found in zktest/src/main/webapp/js/d3.layout.js - About 1 hr to fix

              Function getInputSequences has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  getInputSequences: function(a) {
                      var b = [],
                          c = [],
                          c = a.match(/([0-9]{13,44})/g);
                      if (null == c) c = [];
              Severity: Minor
              Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 1 hr to fix

                Function boxModelAdjustment has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
                    var i = dimension === "width" ? 1 : 0,
                        extra = 0,
                        delta = 0;
                
                
                Severity: Minor
                Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

                  Function bubble has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function bubble() {
                          var milliseconds = this._milliseconds,
                              days = this._days,
                              months = this._months,
                              data = this._data,
                  Severity: Minor
                  Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

                    Function isMomentInputObject has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function isMomentInputObject(input) {
                            var objectTest = isObject(input) && !isObjectEmpty(input),
                                propertyTest = false,
                                properties = [
                                    'years',
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

                      Function doProcess has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function doProcess(cmd: string, data: ({ $u?: string } & zk.Widget | undefined)[]): void { //decoded
                          if (!dataNotReady(cmd, data)) {
                              if (!zAu.processPhase) {
                                  zAu.processPhase = cmd;
                              }
                      Severity: Minor
                      Found in zk/src/main/resources/web/js/zk/au.ts - About 1 hr to fix

                        Function ensureTsdocHeaderNewline has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function ensureTsdocHeaderNewline(tsdoc: TextRange): void {
                                    const startOfDoc = sourceCode.getLocFromIndex(tsdoc.pos);
                                    if (startOfDoc.line === sourceCode.getLocFromIndex(tsdoc.end).line) {
                                        return; // TSDoc is single line.
                                    }
                        Severity: Minor
                        Found in eslint-plugin-zk/src/rules/tsdocValidation.ts - About 1 hr to fix

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

                                  if ((a instanceof short[]) && (b instanceof short[])) {
                                      final short[] as = (short[])a;
                                      final short[] bs = (short[])b;
                                      if (as.length != bs.length)
                                          return false;
                          Severity: Major
                          Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 219..228
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 229..238
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 239..248
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 249..258
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 289..298

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

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

                                  if ((a instanceof int[]) && (b instanceof int[])) {
                                      final int[] as = (int[])a;
                                      final int[] bs = (int[])b;
                                      if (as.length != bs.length)
                                          return false;
                          Severity: Major
                          Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 229..238
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 239..248
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 249..258
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 259..268
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 289..298

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

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

                                  if ((a instanceof char[]) && (b instanceof char[])) {
                                      final char[] as = (char[])a;
                                      final char[] bs = (char[])b;
                                      if (as.length != bs.length)
                                          return false;
                          Severity: Major
                          Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 219..228
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 229..238
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 249..258
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 259..268
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 289..298

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

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

                                  if ((a instanceof long[]) && (b instanceof long[])) {
                                      final long[] as = (long[])a;
                                      final long[] bs = (long[])b;
                                      if (as.length != bs.length)
                                          return false;
                          Severity: Major
                          Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 219..228
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 229..238
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 239..248
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 259..268
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 289..298

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

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

                                  if ((a instanceof boolean[]) && (b instanceof boolean[])) {
                                      final boolean[] as = (boolean[])a;
                                      final boolean[] bs = (boolean[])b;
                                      if (as.length != bs.length)
                                          return false;
                          Severity: Major
                          Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 219..228
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 229..238
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 239..248
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 249..258
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 259..268

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

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

                                  if ((a instanceof byte[]) && (b instanceof byte[])) {
                                      final byte[] as = (byte[])a;
                                      final byte[] bs = (byte[])b;
                                      if (as.length != bs.length)
                                          return false;
                          Severity: Major
                          Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 5 other locations - About 1 hr to fix
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 219..228
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 239..248
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 249..258
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 259..268
                          zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 289..298

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

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

                              public final static String toString(boolean[] array) {
                                  if (array == null)
                                      return "null";
                          
                                  StringBuffer sb = new StringBuffer(128).append('[');
                          Severity: Major
                          Found in zcommon/src/main/java/org/zkoss/util/ArraysX.java and 7 other locations - About 1 hr to fix
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 50..61
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 64..75
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 78..89
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 92..103
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 106..117
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 134..145
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 148..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 96.

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

                              public final static String toString(int[] array) {
                                  if (array == null)
                                      return "null";
                          
                                  StringBuffer sb = new StringBuffer(128).append('[');
                          Severity: Major
                          Found in zcommon/src/main/java/org/zkoss/util/ArraysX.java and 7 other locations - About 1 hr to fix
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 64..75
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 78..89
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 92..103
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 106..117
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 120..131
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 134..145
                          zcommon/src/main/java/org/zkoss/util/ArraysX.java on lines 148..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 96.

                          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