Showing 7,775 of 7,775 total issues

Function d3_scale_pow has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function d3_scale_pow(linear, exponent) {
  var powp = d3_scale_powPow(exponent),
      powb = d3_scale_powPow(1 / exponent);

  function scale(x) {
Severity: Minor
Found in zktest/src/main/webapp/js/d3.js - About 1 hr to fix

    Function showHide has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function showHide( elements, show ) {
        var display, elem,
            values = [],
            index = 0,
            length = elements.length;
    Severity: Minor
    Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

      Function arc has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function arc() {
          var r0 = innerRadius.apply(this, arguments),
              r1 = outerRadius.apply(this, arguments),
              a0 = startAngle.apply(this, arguments) + d3_svg_arcOffset,
              a1 = endAngle.apply(this, arguments) + d3_svg_arcOffset,
      Severity: Minor
      Found in zktest/src/main/webapp/js/d3.js - About 1 hr to fix

        Function updateLocale has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function updateLocale(name, config) {
                if (config != null) {
                    var locale,
                        tmpLocale,
                        parentConfig = baseConfig;
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

          Function slideUp has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function slideIn has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

                  create(context) {
                      // eslint-disable-next-line @typescript-eslint/ban-ts-comment
                      // @ts-ignore
                      // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
                      const escapeFunc: string = context.options[0] && context.options[0]['escapeFunc'] || 'escape';
              Severity: Minor
              Found in eslint-plugin-zk/src/rules/noLocationHrefAssign.ts - About 1 hr to fix

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

                    private static class MyRowComparator implements Comparator, java.io.Serializable {
                        boolean _asc;
                        public MyRowComparator(boolean asc) {
                            _asc = asc;
                        }
                zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelArrays.java on lines 32..44
                zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelLists.java on lines 30..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 89.

                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 Object removeAttribute(String name, boolean recurse) {
                        if (recurse && !hasAttribute(name)) {
                            if (_sess != null) {
                                if (_sess.hasAttribute(name, true))
                                    return _sess.removeAttribute(name, true);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 1 other location - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 1015..1027

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

                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 Object removeAttribute(String name, boolean recurse) {
                        if (recurse && !hasAttribute(name)) {
                            if (_parent != null) {
                                if (_parent.hasAttribute(name, true))
                                    return _parent.removeAttribute(name, true);
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java and 1 other location - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 752..764

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

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

                    private static class MyRowComparator implements Comparator, java.io.Serializable {
                        boolean _asc;
                        public MyRowComparator(boolean asc) {
                            _asc = asc;
                        }
                zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelLists.java on lines 30..42
                zktest/src/main/java/org/zkoss/zktest/test2/select/models/SimpleListModels.java on lines 32..44

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

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

                    private static class MyRowComparator implements Comparator, java.io.Serializable {
                        boolean _asc;
                        public MyRowComparator(boolean asc) {
                            _asc = asc;
                        }
                zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelArrays.java on lines 32..44
                zktest/src/main/java/org/zkoss/zktest/test2/select/models/SimpleListModels.java on lines 32..44

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

                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

                    private static class MyRowComparator implements Comparator, java.io.Serializable {
                        boolean _asc;
                        public MyRowComparator(boolean asc) {
                            _asc = asc;
                        }
                zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelMaps.java on lines 30..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 89.

                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

                    private static class MyRowComparator implements Comparator, java.io.Serializable {
                        boolean _asc;
                        public MyRowComparator(boolean asc) {
                            _asc = asc;
                        }
                zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelSets.java on lines 30..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 89.

                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 invokeSessionInits(Session sess, Object request) throws UiException {
                        final Class<?>[] ary = _sessInits.toArray();
                        for (int j = 0; j < ary.length; ++j) {
                            final Class<?> klass = ary[j];
                            try {
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 877..889

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

                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 init(WebApp app) {
                        app.addScopeListener(_appListener = new ScopeListener() {
                            public void attributeAdded(Scope scope, String name, Object value) {
                                show("app added: "+name+"="+value);
                            }
                Severity: Major
                Found in zktest/src/main/java/org/zkoss/zktest/test2/F2859159.java and 1 other location - About 1 hr to fix
                zktest/src/main/java/org/zkoss/zktest/test2/F2859159.java on lines 45..61

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

                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 String[] getMessages(Component comp, String attr) {
                        List<Message> compMsgs = _compMsgsMap.get(comp);
                        if (compMsgs == null || compMsgs.size() == 0) {
                            return EMPTY_STRING_ARRAY;
                        }
                zkbind/src/main/java/org/zkoss/bind/impl/ValidationMessagesImpl.java on lines 190..201

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

                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 Converter getStatusConverter2(){
                        return new Converter(){
                
                            public Object coerceToUi(Object val, Component component,
                                    BindContext ctx) {
                zktest/src/main/java/org/zkoss/zktest/bind/basic/CollectionTemplateComboboxVM.java on lines 111..128

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

                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 invokeDesktopInits(Desktop desktop, Object request) throws UiException {
                        final Class<?>[] ary = _dtInits.toArray();
                        for (int j = 0; j < ary.length; ++j) {
                            final Class<?> klass = ary[j];
                            try {
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 1 hr to fix
                zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 825..837

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

                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 init(Session sess) {
                        sess.addScopeListener(_sessListener = new ScopeListener() {
                            public void attributeAdded(Scope scope, String name, Object value) {
                                show("sess added: "+name+"="+value);
                            }
                Severity: Major
                Found in zktest/src/main/java/org/zkoss/zktest/test2/F2859159.java and 1 other location - About 1 hr to fix
                zktest/src/main/java/org/zkoss/zktest/test2/F2859159.java on lines 62..78

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

                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