Showing 4,829 of 7,767 total issues

Method updateModelByTag has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
Open

    public void updateModelByTag() {
        fileModel.clear();
        final String r = getDesktop().getWebApp().getRealPath("/");
        final File test2 = new File(r, PATH);
        final String pattern = ((Textbox) getFellow("w1").getFellow("fnt"))
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/MainLayout.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 setModel has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
Open

    public void setModel(TreeModel<?> model) {
        if (model != null) {
            if (!(model instanceof TreeSelectableModel))
                throw new UiException(model.getClass() + " must implement " + TreeSelectableModel.class);

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

Method validate has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
Open

    public void validate(Component comp, Object value) throws WrongValueException {
        if (!_finishParseCst) {
            if (_raw != null) parseCst(_raw);
            _finishParseCst = true;
        }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.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

Page has 65 methods (exceeds 20 allowed). Consider refactoring.
Open

public interface Page extends IdSpace, Scope, ClassResolver {
    /** Returns ID which is unique in the request (never null).
     *
     * <p>Note: it returns null when
     * {@link org.zkoss.zk.ui.util.Initiator#doInit} is called.
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/Page.java - About 1 day to fix

    Method write has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
    Open

        /*package*/ static void write(NameSpace ns, ObjectOutputStream s, Filter filter) throws IOException {
            //1. variables
            final String[] vars = ns.getVariableNames();
            for (int j = vars != null ? vars.length : 0; --j >= 0;) {
                final String nm = vars[j];
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/scripting/bsh/BSHInterpreter.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 getCompaction has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
    Open

        getCompaction: function(a, b, c) {
            c = c || !0;
            var d = [];
            switch (a) {
                case 900:
    Severity: Minor
    Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - 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 unformat has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
    Open

        unformat(fmt: string, val: string, ignoreLocale: boolean, localizedSymbols?: zk.LocalizedSymbols): {raw: string; divscale: number} {
            if (!val) return {raw: val, divscale: 0};
    
            // localized symbols
            localizedSymbols = localizedSymbols || {
    Severity: Minor
    Found in zk/src/main/resources/web/js/zk/fmt/numfmt.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

    File Window.java has 559 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      Function force has 234 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      d3.layout.force = function() {
        var force = {},
            event = d3.dispatch("tick"),
            size = [1, 1],
            drag,
      Severity: Major
      Found in zktest/src/main/webapp/js/d3.layout.js - About 1 day to fix

        File Radiogroup.java has 556 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          File PageDefinition.java has 554 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* PageDefinition.java
          
              Purpose:
                  
              Description:
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 1 day to fix

            File LanguageDefinition.java has 552 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* LanguageDefinition.java
            
                Purpose:
                    
                Description:
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/LanguageDefinition.java - About 1 day to fix

              File AuMultipartUploader.java has 552 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* AuMultipartUploader.java
              
                  Purpose:
              
                  Description:
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/au/http/AuMultipartUploader.java - About 1 day to fix

                Method defineFunction has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void defineFunction(String prefix, String function, String className,
                            String methodName) throws ClassNotFoundException,
                            NoSuchMethodException {
                
                        if (prefix == null || function == null || className == null ||
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/ELProcessor.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 buildRootCtx has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
                Open

                    private ComponentMatchCtx buildRootCtx() {
                        Component rt = _root == null ? _page.getFirstRoot() : _root;
                        if (_posOffset > 0) {
                            Selector selector = _selectorList.get(0);
                            for (int i = 0; i < _posOffset; i++) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.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 syncModel0 has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void syncModel0(int offset, int limit) {
                        int min = offset;
                        int max = offset + limit - 1;
                
                        final ListModel _model = _listbox.getModel();
                Severity: Minor
                Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.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 starteffect has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
                Open

                function starteffect(dg: zk.Draggable): void {
                    var ctrl = dg.control as unknown as zul.WScroll,
                        opts = ctrl.opts;
                
                    dg._steps = opts.startStep;
                Severity: Minor
                Found in zul/src/main/resources/web/js/zul/WScroll.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

                Parser has 62 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class Parser {
                    private static final Logger log = LoggerFactory.getLogger(Parser.class);
                
                    private final WebApp _wapp;
                    private final Locator _locator;
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 1 day to fix

                  ListModelMapProxy has 62 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class ListModelMapProxy<K, V> extends ListModelMap<K, V> implements Proxy, FormProxyObject, Serializable {
                      private static final long serialVersionUID = 20210608113022L;
                      private static final Logger log = LoggerFactory.getLogger(ListModelMapProxy.class);
                      private MapForCache<K, V> _cache;
                      private ListModelMap<K, V> _origin;
                  Severity: Major
                  Found in zkbind/src/main/java/org/zkoss/bind/proxy/ListModelMapProxy.java - About 1 day to fix

                    ListModelSetProxy has 62 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class ListModelSetProxy<E> extends ListModelSet<E> implements Proxy, FormProxyObject, Serializable {
                        private static final long serialVersionUID = 20210608113022L;
                        private ListModelSet<E> _cache;
                        private ListModelSet<E> _origin;
                        private boolean _dirty;
                    Severity: Major
                    Found in zkbind/src/main/java/org/zkoss/bind/proxy/ListModelSetProxy.java - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language