Showing 7,775 of 7,775 total issues

Function getWidthOrHeight has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getWidthOrHeight( elem, dimension, extra ) {

    // Start with computed style
    var styles = getStyles( elem ),

Severity: Minor
Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

    Function computeMonthsParse has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function computeMonthsParse() {
            function cmpLenRev(a, b) {
                return b.length - a.length;
            }
    
    
    Severity: Minor
    Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

      Function localeErasParse has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function localeErasParse(eraName, format, strict) {
              var i,
                  l,
                  eras = this.eras(),
                  name,
      Severity: Minor
      Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

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

        function calendar$mold$(out) {
            var renderer = zul.db.Renderer,
                uuid = this.uuid,
                view = this._view,
                localizedSymbols = this.getLocalizedSymbols(),
        Severity: Minor
        Found in zul/src/main/resources/web/js/zul/db/mold/calendar.js - About 1 hr to fix

          Function scrollbarWidth has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              scrollbarWidth(): number {
                  var devicePixelRatio = zUtl.getDevicePixelRatio(),
                      body = document.body;
                  if (this['_lastDevicePixelRatio'] != devicePixelRatio) {
                      this['_lastDevicePixelRatio'] = devicePixelRatio;
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/dom.ts - About 1 hr to fix

            Function bindTapHold_ has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                bindTapHold_() {
                    if (this.isListen('onRightClick') || (window.zul && this instanceof zul.Widget && this.getContext())) { //also register context menu to tapHold event
                        this._holdTime = 800;
                        this._startHold = (evt: JQuery.TouchEventBase): void => {
                            if (!this._rightClickPending) {
            Severity: Minor
            Found in zk/src/main/resources/web/js/zk/domtouch.ts - About 1 hr to fix

              Function _updateDrag has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _updateDrag(pt: zk.Offset, evt: zk.Event): void {
                      if (!this.dragging) {
                          let v = this.opts.initSensitivity;
                          if (v && pt[0] <= _initPt[0] + v && pt[0] >= _initPt[0] - v
                          && pt[1] <= _initPt[1] + v && pt[1] >= _initPt[1] - v)
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/drag.ts - About 1 hr to fix

                Function create has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    create(context) {
                        const sourceCode = context.getSourceCode();
                        return {
                            CallExpression(node) {
                                const { callee } = node;
                Severity: Minor
                Found in eslint-plugin-zk/src/rules/preferNativeInstanceof.ts - About 1 hr to fix

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

                      public Order(String id, String description, double price, int quantity, Date creationDate) {
                          super();
                          this.id = id;
                          this.description = description;
                          this.price = price;
                  zktest/src/main/java/org/zkoss/zktest/bind/issue/B01196BinderUiLcConfusion.java on lines 164..175

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

                  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

                          Order(String id, String description, double price, int quantity, Date creationDate) {
                              super();
                              this.id = id;
                              this.description = description;
                              this.price = price;
                  zktest/src/main/java/org/zkoss/zktest/bind/databinding/bean/Order.java on lines 37..48

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

                  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

                      public int indexOf(Object o) {
                          final int size = size();
                          if (o == null) {
                              for (int i = 0; i < size; i++)
                                  if (testEquals(get(i), null))
                  Severity: Major
                  Found in zkbind/src/main/java/org/zkoss/bind/proxy/ListProxy.java and 1 other location - About 1 hr to fix
                  zkbind/src/main/java/org/zkoss/bind/proxy/ListModelListProxy.java on lines 277..289

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

                  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

                      public int indexOf(Object o) {
                          final int size = size();
                          if (o == null) {
                              for (int i = 0; i < size; i++)
                                  if (testEquals(get(i), null))
                  zkbind/src/main/java/org/zkoss/bind/proxy/ListProxy.java on lines 74..86

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

                  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

                      public class Person {
                          private String firstName;
                          private String lastName;
                  
                          public Person(String firstName, String lastName) {
                  zktest/src/main/java/org/zkoss/zktest/bind/issue/B00758Indirect.java on lines 54..83

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

                  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

                      public class Person {
                          private String firstName;
                          private String lastName;
                  
                          public Person(String firstName, String lastName) {
                  zktest/src/main/java/org/zkoss/zktest/bind/issue/B00950ReferenceChange.java on lines 42..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 94.

                  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

                          } else if (Double.class == cls || double.class == cls) {
                              if (val == null) {
                                  return Double.class == cls ? null: Objects.ZERO_DOUBLE;
                              } else if (val instanceof Double) { //double.class
                                  return val;
                  Severity: Major
                  Found in zcommon/src/main/java/org/zkoss/lang/Classes.java and 1 other location - About 1 hr to fix
                  zcommon/src/main/java/org/zkoss/lang/Classes.java on lines 1374..1386

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

                  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

                  package org.zkoss.zktest.bind.issue;
                  
                  import java.util.ArrayList;
                  import java.util.List;
                  import java.util.Set;
                  zktest/src/main/java/org/zkoss/zktest/bind/issue/B01529SelectedItemsIndex.java on lines 1..33

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

                  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

                  package org.zkoss.zktest.bind.issue;
                  
                  import java.util.ArrayList;
                  import java.util.List;
                  import java.util.Set;
                  zktest/src/main/java/org/zkoss/zktest/bind/issue/B01085NPEReferenceBinding.java on lines 1..33

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

                  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

                          } else if (Long.class == cls || long.class == cls) {
                              if (val == null) {
                                  return Long.class == cls ? null: Objects.ZERO_LONG;
                              } else if (val instanceof Long) { //long.class
                                  return val;
                  Severity: Major
                  Found in zcommon/src/main/java/org/zkoss/lang/Classes.java and 1 other location - About 1 hr to fix
                  zcommon/src/main/java/org/zkoss/lang/Classes.java on lines 1386..1398

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

                  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

                          this.domUnlisten_(this.$n('btnB'), evtName, this.proxy(this._doClickB))
                              .domUnlisten_(this.$n('btnA'), evtName, this.proxy(this._doClickA));
                  Severity: Major
                  Found in zktest/src/main/webapp/test2/B90-ZK-4439.js and 1 other location - About 1 hr to fix
                  zktest/src/main/webapp/test2/B90-ZK-4439.js on lines 5..6

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 63.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          this.domListen_(this.$n('btnA'), evtName, this.proxy(this._doClickA))
                              .domListen_(this.$n('btnB'), evtName, this.proxy(this._doClickB));
                  Severity: Major
                  Found in zktest/src/main/webapp/test2/B90-ZK-4439.js and 1 other location - About 1 hr to fix
                  zktest/src/main/webapp/test2/B90-ZK-4439.js on lines 10..11

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 63.

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

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

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

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

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language