Showing 7,775 of 7,775 total issues

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

    public MapProxy(Map<K, V> origin, Annotation[] callerAnnots) {
        _origin = origin;
        _cache = new MapForCache<K, V>(origin.size());
        if (callerAnnots != null) {
            for (Annotation annot : callerAnnots) {
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/proxy/MapProxy.java and 1 other location - About 1 hr to fix
zkbind/src/main/java/org/zkoss/bind/proxy/ListModelMapProxy.java on lines 57..69

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

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 ListModelMapProxy(ListModelMap<K, V> origin, Annotation[] callerAnnots) {
        _origin = origin;
        _cache = new ListModelMapProxy<K, V>.MapForCache<>(origin.size());
        if (callerAnnots != null) {
            for (Annotation annot : callerAnnots) {
zkbind/src/main/java/org/zkoss/bind/proxy/MapProxy.java on lines 54..66

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

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 (!this._isStretchPack() && this._pack2) out.push(' valign="', /*safe*/ zul.box.Box._toValign(this._pack2), '"');
Severity: Major
Found in zul/src/main/resources/web/js/zul/box/mold/vbox.js and 1 other location - About 1 hr to fix
zul/src/main/resources/web/js/zul/box/mold/hbox.js on lines 33..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 56.

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 (!this._isStretchPack() && this._pack2) out.push(' align="', /*safe*/ zul.box.Box._toHalign(this._pack2), '"');
Severity: Major
Found in zul/src/main/resources/web/js/zul/box/mold/hbox.js and 1 other location - About 1 hr to fix
zul/src/main/resources/web/js/zul/box/mold/vbox.js on lines 27..27

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

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

  stack.order = function(x) {
    if (!arguments.length) return order;
    order = typeof x === "function" ? x : d3_layout_stackOrders[x];
    return stack;
  };
Severity: Major
Found in zktest/src/main/webapp/js/d3.layout.js and 1 other location - About 1 hr to fix
zktest/src/main/webapp/js/d3.layout.js on lines 755..759

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

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

  stack.offset = function(x) {
    if (!arguments.length) return offset;
    offset = typeof x === "function" ? x : d3_layout_stackOffsets[x];
    return stack;
  };
Severity: Major
Found in zktest/src/main/webapp/js/d3.layout.js and 1 other location - About 1 hr to fix
zktest/src/main/webapp/js/d3.layout.js on lines 749..753

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

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

            jq(this.$n()).on('touchstart', this.proxy(this._dblTapStart))
                .on('touchend', this.proxy(this._dblTapEnd));
Severity: Major
Found in zk/src/main/resources/web/js/zk/domtouch.ts and 1 other location - About 1 hr to fix
zk/src/main/resources/web/js/zk/domtouch.ts on lines 191..192

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

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

            jq(this.$n()).off('touchstart', this.proxy(this._dblTapStart))
                .off('touchend', this.proxy(this._dblTapEnd));
Severity: Major
Found in zk/src/main/resources/web/js/zk/domtouch.ts and 1 other location - About 1 hr to fix
zk/src/main/resources/web/js/zk/domtouch.ts on lines 183..184

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

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

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

    @SuppressWarnings("unchecked")
    private FilterMap segmentInner(Map map) {
        final Map segFound = new HashMap();
        for (Iterator it = map.entrySet().iterator(); it.hasNext();) {
            final Map.Entry me = (Map.Entry)it.next();

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

        public static Locale getByFallback(Collection<Locale> values, Locale locale) {
            if (values.contains(locale))
                return locale;
    
            final String lang = locale.getLanguage();
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/util/Locales.java - About 1 hr to fix

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

          public void
          startElement(String nsURI, String lname, String tname, Attributes attrs)
          throws SAXException {
      //        if (log.finerable())
      //            log.finer(message("start element: nsURI=\"" + nsURI + "\", lname=" + lname + ", tname=" + tname
      Severity: Minor
      Found in zcommon/src/main/java/org/zkoss/idom/input/SAXHandler.java - About 1 hr to fix

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

          final public void MapEntry() throws ParseException {
                                    /*@bgen(jjtree) MapEntry */
          AstMapEntry jjtn000 = new AstMapEntry(JJTMAPENTRY);
          boolean jjtc000 = true;
          jjtree.openNodeScope(jjtn000);
        Severity: Minor
        Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 1 hr to fix

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

              public void setValue(EvaluationContext ctx, Object value)
                      throws ELException {
                  Target t = getTarget(ctx);
                  ctx.setPropertyResolved(false);
                  ELResolver resolver = ctx.getELResolver();
          Severity: Minor
          Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstValue.java - About 1 hr to fix

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

              final public void DynamicExpression() throws ParseException {
                                                           /*@bgen(jjtree) DynamicExpression */
              AstDynamicExpression jjtn000 = new AstDynamicExpression(JJTDYNAMICEXPRESSION);
              boolean jjtc000 = true;
              jjtree.openNodeScope(jjtn000);
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 1 hr to fix

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

                final public void BracketSuffix() throws ParseException {
                                                     /*@bgen(jjtree) BracketSuffix */
                AstBracketSuffix jjtn000 = new AstBracketSuffix(JJTBRACKETSUFFIX);
                boolean jjtc000 = true;
                jjtree.openNodeScope(jjtn000);
              Severity: Minor
              Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 1 hr to fix

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

                  final public void DeferredExpression() throws ParseException {
                                                                 /*@bgen(jjtree) DeferredExpression */
                  AstDeferredExpression jjtn000 = new AstDeferredExpression(JJTDEFERREDEXPRESSION);
                  boolean jjtc000 = true;
                  jjtree.openNodeScope(jjtn000);
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 1 hr to fix

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

                      private static boolean isAssignableFrom(Class<?> src, Class<?> target) {
                          // src will always be an object
                          // Short-cut. null is always assignable to an object and in EL null
                          // can always be coerced to a valid value for a primitive
                          if (src == null) {
                  Severity: Minor
                  Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java - About 1 hr to fix

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

                        static boolean isAssignableFrom(Class<?> src, Class<?> target) {
                            // src will always be an object
                            // Short-cut. null is always assignable to an object and in EL null
                            // can always be coerced to a valid value for a primitive
                            if (src == null) {
                    Severity: Minor
                    Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 hr to fix

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

                          @Listen("onClick=#start")
                          public void startLongOp() {
                              _running.set(true);
                              logThread("Start");
                      
                      

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

                            public void render(Treeitem treeitem, Object data, int index) throws Exception {
                                Treerow row;
                                if(treeitem.getTreerow()==null){// tree row not create yet.
                                    row = new Treerow();
                                    row.setParent(treeitem);
                          Severity
                          Category
                          Status
                          Source
                          Language