Showing 7,775 of 7,775 total issues

Function _scrollIntoView has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _scrollIntoView(parent?: Element | boolean): this {
        // eslint-disable-next-line zk/noNull
        var n: HTMLElement | null = this.jq[0];
        if (n) {
            var real = jq('#' + n.id + '-real')[0];
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - About 1 hr to fix

    Function _getTextSize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function _getTextSize(zkc: zk.JQZK, zkp: zk.JQZK, zkpOffset: zk.Offset): zk.Offset {
        let $zkc = zkc.jq,
            $prev = $zkc.prev(),
            pos: zk.Offset = [0, 0],
            coldVal: Record<string, string>,
    Severity: Minor
    Found in zk/src/main/resources/web/js/zk/flex.ts - About 1 hr to fix

      Function center has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          center(flags?: string): this {
              var el = this.jq[0],
                  wdgap = this.offsetWidth(),
                  hghgap = this.offsetHeight();
      
      
      Severity: Minor
      Found in zk/src/main/resources/web/js/zk/dom.ts - About 1 hr to fix

        Function zkShowCrashMessage has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    window.zkShowCrashMessage = function () {
                        var styleHTML = '<style> a:visited {color: white;} </style>',
                            divHTML = '<div style="background: rgb(35,48,64); text-align: center; color: white; position: absolute; \
                                top: 0; left: 0; right: 0; bottom: 0; margin: auto; width: 50%; height: 300px; font-size: 20px;">',
                            iconHTML = '<i class="z-icon-frown-o" style="font-size: 5em; display: block;"></i>',
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/crashmsg.ts - About 1 hr to fix

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

              static public class Item implements Serializable{
                  private static final long serialVersionUID = 1L;
          
                  String name;
                  
          zktest/src/main/java/org/zkoss/zktest/bind/issue/B00690ClusterEnv.java on lines 78..105

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

          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

              static public class Item implements Serializable{
                  private static final long serialVersionUID = 1L;
          
                  String name;
                  
          zktest/src/main/java/org/zkoss/zktest/bind/issue/B00869Serialization.java on lines 75..100

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

          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 addGlobalCommandBinding(Component comp, String evtnm, String commandExpr, Map<String, Object> args) {
                  checkInit();
                  final CommandBinding binding = newCommandBinding(comp, evtnm, commandExpr, args);
                  addBinding(comp, evtnm, binding);
                  registerCommandEventListener(comp, evtnm, binding, true);
          Severity: Major
          Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java and 1 other location - About 1 hr to fix
          zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java on lines 1536..1547

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

          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 addCommandBinding(Component comp, String evtnm, String commandExpr, Map<String, Object> args) {
                  checkInit();
                  final CommandBinding binding = newCommandBinding(comp, evtnm, commandExpr, args);
                  addBinding(comp, evtnm, binding);
                  registerCommandEventListener(comp, evtnm, binding, false);
          Severity: Major
          Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java and 1 other location - About 1 hr to fix
          zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java on lines 1549..1560

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

          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

          Consider simplifying this complex logical expression.
          Open

                  if (!nested || (_itemsSpecified && _items == null) || (_endSpecified && _end < _beg)
                          || (!_itemsSpecified && !_endSpecified) || !isEffective())
                      return;
          Severity: Critical
          Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                if ( ( !support.boxSizingReliable() && isBorderBox ||
            
                    // Support: IE 10 - 11+, Edge 15 - 18+
                    // IE/Edge misreport `getComputedStyle` of table rows with width/height
                    // set in CSS while `offset*` properties report correct values.
            Severity: Critical
            Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      } else if ((mindex >= 0 && mindex <= i /*&& mmindex >= i location French will lose last char */)
                          || (eindex >= 0 && eindex <= i) || (aa > -1 && aa <= i) || (gg > -1 && gg <= i)) {
                          if (c.match(/\w/)) {
                              ary.push(c);
                          } else {
              Severity: Critical
              Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 1 hr to fix

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

                    Node createNode(String name,int children,int nested){
                        Node n = new Node(name);
                        if(nested>0){
                            for(int i=0;i<children;i++){
                                n.addChild(createNode(name+"_"+i,i==children-1?0:children,nested-1));
                zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenNavVM.java on lines 27..35

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

                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

                        for (Map.Entry<Method, MatchResult> entry : candidates.entrySet()) {
                            int cmp = entry.getValue().compareTo(bestMatch);
                            if (cmp > 0 || match == null) {
                                bestMatch = entry.getValue();
                                match = entry.getKey();
                zel/src/main/java/org/zkoss/zel/Util.java on lines 326..335

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

                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

                        for (Map.Entry<Wrapper, MatchResult> entry : candidates.entrySet()) {
                            int cmp = entry.getValue().compareTo(bestMatch);
                            if (cmp > 0 || match == null) {
                                bestMatch = entry.getValue();
                                match = entry.getKey();
                Severity: Major
                Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 1 hr to fix
                zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java on lines 255..264

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

                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

                    static {
                        _properties.put("_loaded", new BooleanPropertyAccess() {
                            public void setValue(Component cmp, Boolean loaded) {
                                ((Listitem) cmp)._loaded = loaded;
                            }
                Severity: Major
                Found in zul/src/main/java/org/zkoss/zul/Listitem.java and 1 other location - About 1 hr to fix
                zul/src/main/java/org/zkoss/zul/Row.java on lines 259..278

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

                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 (comp.getPage() == null) {
                            final Map<?, ?> currentArg = Executions.getCurrent().getArg();
                            ((ComponentCtrl) comp).addCallback(ComponentCtrl.AFTER_PAGE_ATTACHED, new Callback() {
                                public void call(Object data) {
                                    try {
                Severity: Major
                Found in zkbind/src/main/java/org/zkoss/bind/BindComposer.java and 1 other location - About 1 hr to fix
                zkbind/src/main/java/org/zkoss/bind/BindComposer.java on lines 170..185

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

                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

                    static {
                        _properties.put("_loaded", new BooleanPropertyAccess() {
                            public void setValue(Component cmp, Boolean loaded) {
                                ((Row) cmp)._loaded = loaded;
                            }
                Severity: Major
                Found in zul/src/main/java/org/zkoss/zul/Row.java and 1 other location - About 1 hr to fix
                zul/src/main/java/org/zkoss/zul/Listitem.java on lines 356..375

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

                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

                /* RowLabelComparator.java
                
                {{IS_NOTE
                    Purpose:
                        
                zksandbox/src/main/java/org/zkoss/zksandbox/RowDetailComparator.java on lines 1..43
                zksandbox/src/main/java/org/zkoss/zksandbox/RowLabelComparator.java on lines 1..42

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

                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

                /* RowLabelComparator.java
                
                {{IS_NOTE
                    Purpose:
                        
                zksandbox/src/main/java/org/zkoss/zksandbox/RowDetailComparator.java on lines 1..43
                zktest/src/main/java/org/zkoss/zktest/util/RowLabelComparator.java on lines 1..42

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

                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 Object getValue(ELContext context, Object base, Object property) {
                        context.setPropertyResolved(false);
                        int sz = this.size;
                        Object result = null;
                        for (int i = 0; i < sz; i++) {
                Severity: Major
                Found in zel/src/main/java/org/zkoss/zel/CompositeELResolver.java and 1 other location - About 1 hr to fix
                zel/src/main/java/org/zkoss/zel/CompositeELResolver.java on lines 166..177

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

                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