Showing 7,767 of 7,767 total issues

AbstractExecution has 74 methods (exceeds 20 allowed). Consider refactoring.
Open

public abstract class AbstractExecution implements Execution, ExecutionCtrl {
    private static final Logger _zklog = LoggerFactory.getLogger("org.zkoss.zk.log");

    private Desktop _desktop;
    private Page _curpage;
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractExecution.java - About 1 day to fix

    File WeakIdentityMap.java has 619 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* WeakIdentityMap.java
    
        Purpose:
            
        Description:
    Severity: Major
    Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java - About 1 day to fix

      File InputElement.java has 619 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* InputElement.java
      
          Purpose:
              
          Description:
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/impl/InputElement.java - About 1 day to fix

        HtmlShadowElement has 73 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public abstract class HtmlShadowElement extends AbstractComponent implements ShadowElement, ShadowElementCtrl {
            private static final Logger log = LoggerFactory.getLogger(HtmlShadowElement.class);
            private static final long serialVersionUID = 20141022145906L;
            private Component _firstInsertion;
            private Component _lastInsertion;
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 1 day to fix

          Chart has 73 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class Chart extends Imagemap {
              private static final long serialVersionUID = 20091008183601L;
              //chart type
              public static final String PIE = "pie";
              public static final String FUNNEL = "funnel";
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/Chart.java - About 1 day to fix

            Method parse has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
            Open

                public void parse(Element root, Configuration config, Locator locator) throws Exception {
                    l_out: for (Iterator it = root.getElements().iterator(); it.hasNext();) {
                        final Element el = (Element) it.next();
                        final String elnm = el.getName();
                        // B65-ZK-1671: ThemeProvider specified in metainfo/zk/zk.xml may get overridden by default
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.java - About 1 day to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method execCreate0 has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
            Open

                private static final Component[] execCreate0(CreateInfo ci, NodeInfo parentInfo, Component parent,
                        Component insertBefore) {
                    final List<Component> created = new LinkedList<Component>();
                    final Page page = ci.page;
                    final PageDefinition pagedef = parentInfo.getPageDefinition();
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 1 day to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method processItem has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
            Open

                private static final Media processItem(Desktop desktop, FileItem fi, boolean alwaysNative,
                        org.zkoss.zk.ui.sys.DiskFileItemFactory factory) throws IOException {
                    String name = getBaseName(fi);
                    if (name != null) {
                        //Not sure whether a name might contain ;jsessionid or similar
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/au/http/AuMultipartUploader.java - About 1 day to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                private static class WorkingThread extends Thread {
                    private static Color colors[] = { Color.blue, Color.cyan, Color.green,
                            Color.magenta, Color.orange, Color.pink, Color.red,
                            Color.yellow, Color.lightGray, Color.white };
            
            zksandbox/src/main/java/org/zkoss/zksandbox/CometServerPush.java on lines 63..174

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

            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 WorkingThread extends Thread {
                    private static Color colors[] = { Color.blue, Color.cyan, Color.green,
                            Color.magenta, Color.orange, Color.pink, Color.red,
                            Color.yellow, Color.lightGray, Color.white };
            
            zktest/src/main/java/org/zkoss/zktest/test2/CometServerPush.java on lines 75..186

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

            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

            d3.max = function(array, f) {
              var i = -1,
                  n = array.length,
                  a,
                  b;
            Severity: Major
            Found in zktest/src/main/webapp/js/d3.js and 1 other location - About 1 day to fix
            zktest/src/main/webapp/js/d3.js on lines 80..93

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

            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

            d3.min = function(array, f) {
              var i = -1,
                  n = array.length,
                  a,
                  b;
            Severity: Major
            Found in zktest/src/main/webapp/js/d3.js and 1 other location - About 1 day to fix
            zktest/src/main/webapp/js/d3.js on lines 94..107

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

            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 onEvent has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
            Open

                    public void onEvent(Event event) {
                        if (inPagingMold() && event instanceof PagingEvent) {
                            PagingEvent pe = (PagingEvent) event;
                            if (_model instanceof Pageable) {
                                ((Pageable) _model).setPageSize(pe.getPageable().getPageSize());
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 1 day to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function sendNow has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
            Open

                    export function sendNow(dt: zk.Desktop): boolean {
                        if (zAu.disabledRequest) {
                            if (zk.processing)
                                zk.endProcessing();
                            return false;
            Severity: Minor
            Found in zk/src/main/resources/web/js/zk/au.ts - About 1 day to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Input has 71 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class Input extends AbstractTag {
                private transient boolean _byClient;
            
                static {
                    addClientEvent(Input.class, Events.ON_CHANGE, 0);
            Severity: Major
            Found in zhtml/src/main/java/org/zkoss/zhtml/Input.java - About 1 day to fix

              AbstractTreeModel has 71 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public abstract class AbstractTreeModel<E> implements TreeModel<E>, TreeSelectableModel, TreeOpenableModel,
                      Selectable<E>, Openable<E>, java.io.Serializable, PageableModel {
              
                  private static final Logger log = LoggerFactory.getLogger(AbstractTreeModel.class);
              
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java - About 1 day to fix

                Window has 71 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class Window extends XulElement implements Framable, IdSpace {
                    private static final Logger log = LoggerFactory.getLogger(Window.class);
                    private static final long serialVersionUID = 20100721L;
                
                    private transient Caption _caption;
                Severity: Major
                Found in zul/src/main/java/org/zkoss/zul/Window.java - About 1 day to fix

                  File Datebox.java has 604 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* Datebox.java
                  
                      Purpose:
                  
                      Description:
                  Severity: Major
                  Found in zul/src/main/java/org/zkoss/zul/Datebox.java - About 1 day to fix

                    Method toNumberOnly has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected Object[] toNumberOnly(String val) {
                            if (val == null)
                                return new Object[] { null, null };
                    
                            final DecimalFormatSymbols symbols = new DecimalFormatSymbols(getDefaultLocale());
                    Severity: Minor
                    Found in zul/src/main/java/org/zkoss/zul/impl/NumberInputElement.java - About 1 day to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    File WScroll.ts has 600 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* WScroll.ts
                    
                        Purpose:
                    
                        Description:
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language