Showing 7,775 of 7,775 total issues

Method getBrowser has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static Browser getBrowser() {
        Double number = Servlets.getBrowser(ServletFns.getCurrentRequest(), "ff");
        if (number != null && number >= 3.6)
            return Browser.Firefox;
        number = Servlets.getBrowser(ServletFns.getCurrentRequest(), "ie");
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/fn/ThemeFns.java - About 1 hr to fix

    Function d3_svg_lineHermite has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function d3_svg_lineHermite(points, tangents) {
      if (tangents.length < 1
          || (points.length != tangents.length
          && points.length != tangents.length + 2)) {
        return d3_svg_lineLinear(points);
    Severity: Minor
    Found in zktest/src/main/webapp/js/d3.js - About 1 hr to fix

      Function d3_selection_classed has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function d3_selection_classed(name, value) {
        var re = new RegExp("(^|\\s+)" + d3.requote(name) + "(\\s+|$)", "g");
      
        // If no value is specified, return the first value.
        if (arguments.length < 2) {
      Severity: Minor
      Found in zktest/src/main/webapp/js/d3.js - About 1 hr to fix

        Function _scrlIntoView has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function _scrlIntoView(outer: HTMLElement | null, inner: HTMLElement | null, info: ScrollIntoViewInfo | undefined, excludeHorizontal: boolean): ScrollIntoViewInfo {
            if (outer && inner) {
                var ooft = zk(outer).revisedOffset(),
                    ioft = info ? info.oft : zk(inner).revisedOffset(),
                    top = ioft[1] - ooft[1]
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/dom.ts - About 1 hr to fix

          Function _createWrapper has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _createWrapper(element: JQuery): JQuery {
                      // ZK-5354: Update animation implementation to avoid iframe reloading
                      if (element.find('iframe').length) {
                          return element;
                      }
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/anima.ts - About 1 hr to fix

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

                @AfterCompose
                public void init(@ScopeParam("applicationScopeVar") String applicationScope,
                        @ScopeParam("sessionScopeVar") String sessionScope,
                        @ScopeParam("desktopScopeVar") String desktopScope,
                        @ScopeParam("pageScopeVar") String pageScope,
            zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_2772VM.java on lines 62..73

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

            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

                    {
                        this.name0 = name0;
                        this.name1 = name1;
                        this.name2 = name2;
                        this.name3 = name3;
            zktest/src/main/java/org/zkoss/zktest/bind/basic/ScopeParamVM.java on lines 26..47

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

            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 init has 12 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    @ContextParam(ContextType.BIND_CONTEXT) BindContext bindContext,
                    @ContextParam(ContextType.BINDER) Binder binder,
                    @ContextParam(ContextType.TRIGGER_EVENT) Event event,
                    @ContextParam(ContextType.COMMAND_NAME) String commandName,
                    @ContextParam(ContextType.EXECUTION) Execution execution,

              Method show has 12 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      @ContextParam(ContextType.BIND_CONTEXT) BindContext bindContext,
                      @ContextParam(ContextType.BINDER) Binder binder,
                      @ContextParam(ContextType.TRIGGER_EVENT) Event event,
                      @ContextParam(ContextType.COMMAND_NAME) String commandName,
                      @ContextParam(ContextType.EXECUTION) Execution execution,

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

                        if (recurse) {
                            if (_parent != null)
                                return _parent.hasAttributeOrFellow(name, true);
                            if (_page != null)
                                return _page.hasAttributeOrFellow(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/AbstractComponent.java on lines 1049..1061

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

                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

                                for (int i = 0; i < 3; i++) {
                                    foods.add(new Food("Seafood" + y, "Basa"));
                                    foods.add(new Food("Seafood" + y, "Bluefish"));
                                    foods.add(new Food("Seafood" + y, "Dorade"));
                                    foods.add(new Food("Seafood" + y, "Salmon"));
                zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2534Group.java on lines 106..112

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

                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

                                for (int i = 0; i < 3; i++) {
                                    foods.add(new Food("Fruits" + y, "Apples"));
                                    foods.add(new Food("Fruits" + y, "Bananas"));
                                    foods.add(new Food("Fruits" + y, "Oranges"));
                                    foods.add(new Food("Fruits" + y, "Grapes"));
                zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2534Group.java on lines 99..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 100.

                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 (recurse) {
                            if (_parent != null)
                                return _parent.getAttributeOrFellow(name, true);
                            if (_page != null)
                                return _page.getAttributeOrFellow(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/AbstractComponent.java on lines 1175..1187

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

                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

                    for (; p2 && p2._vflex == 'min'; p2 = p2.parent) {
                        delete p2._vflexsz;
                        r2 = p2;
                        ++j2;
                        if (p2.ignoreFlexSize_('h')) //p2 will not affect its parent's flex size
                Severity: Major
                Found in zk/src/main/resources/web/js/zk/utl.ts and 1 other location - About 1 hr to fix
                zk/src/main/resources/web/js/zk/utl.ts on lines 84..90

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

                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

                    static postGlobalCommand(dom: HTMLElement, command: string, args?: Record<string, unknown>, opt?: zk.EventOptions, timeout?: number): void {
                        var w = zk.Widget.$(dom);
                        if (w) {
                            var binder = w.$binder();
                            if (binder) {
                Severity: Major
                Found in zkbind/src/main/resources/web/js/zkbind/Binder.ts and 1 other location - About 1 hr to fix
                zkbind/src/main/resources/web/js/zkbind/Binder.ts on lines 336..344

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

                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

                    static postCommand(dom: HTMLElement, command: string, args?: Record<string, unknown>, opt?: zk.EventOptions, timeout?: number): void {
                        var w = zk.Widget.$(dom);
                        if (w) {
                            var binder = w.$binder();
                            if (binder) {
                Severity: Major
                Found in zkbind/src/main/resources/web/js/zkbind/Binder.ts and 1 other location - About 1 hr to fix
                zkbind/src/main/resources/web/js/zkbind/Binder.ts on lines 353..361

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

                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

                    for (; p1 && p1._hflex == 'min'; p1 = p1.parent) {
                        delete p1._hflexsz;
                        r1 = p1;
                        ++j1;
                        if (p1.ignoreFlexSize_('w')) //p1 will not affect its parent's flex size
                Severity: Major
                Found in zk/src/main/resources/web/js/zk/utl.ts and 1 other location - About 1 hr to fix
                zk/src/main/resources/web/js/zk/utl.ts on lines 94..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 65.

                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 class Iter implements Iterator<Component> {
                        private final ListIterator<Component> _it = getChildren().listIterator();
                
                        public boolean hasNext() {
                            while (_it.hasNext()) {
                Severity: Major
                Found in zul/src/main/java/org/zkoss/zul/Grid.java and 1 other location - About 1 hr to fix
                zul/src/main/java/org/zkoss/zul/Tree.java on lines 3061..3086

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

                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 class SetHandlerForCache implements MethodHandler {
                        private Set _origin;
                
                        public SetHandlerForCache(Set origin) {
                            _origin = origin;
                zkbind/src/main/java/org/zkoss/bind/proxy/MapProxy.java on lines 275..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 99.

                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 class SetHandlerForCache implements MethodHandler {
                        private Set _origin;
                        public SetHandlerForCache(Set origin) {
                            _origin = origin;
                        }
                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 463..479

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

                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