Showing 4,841 of 7,782 total issues

Method isSelectAll has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

        public boolean isSelectAll() {
            Selectable smodel = (Selectable) model;
            boolean isGroupSelectable = model.isGroupSelectable();
            for (int i = 0, j = model.getGroupCount(); i < j; i++) {
                if (isGroupSelectable) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractGroupsModel.java - About 4 hrs 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 listbox$mold$ has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

function listbox$mold$(out) {
    var uuid = this.uuid,
        zclsHTML = this.getZclass(),
        innerWidth = zUtl.encodeXML(this.getInnerWidth()),
        wdAttr = innerWidth === '100%' ? ' width="100%"' : '',
Severity: Minor
Found in zul/src/main/resources/web/js/zul/sel/mold/listbox.js - About 4 hrs 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 tree$mold$ has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

function tree$mold$(out) {
    var uuid = this.uuid,
        innerWidth = zUtl.encodeXML(this.getInnerWidth()),
        width = innerWidth === '100%' ? ' width="100%"' : '',
        wdStyle = innerWidth !== '100%' ? 'width:' + innerWidth : '',
Severity: Minor
Found in zul/src/main/resources/web/js/zul/sel/mold/tree.js - About 4 hrs 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 initDataListener has 118 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void initDataListener() {
        if (INVALIDATE_THRESHOLD == -1) {
            INVALIDATE_THRESHOLD = Utils.getIntAttribute(this, "org.zkoss.zul.invalidateThreshold", 10, true);
        }
        if (_dataListener == null)
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Combobox.java - About 4 hrs to fix

    File Verifier.java has 362 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* Verifier.java
    
    
        Purpose:
        Description:
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/idom/Verifier.java - About 4 hrs to fix

      File JsContentRenderer.java has 362 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* JsContentRenderer.java
      
          Purpose:
      
          Description:
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 4 hrs to fix

        File ComponentsCtrl.java has 362 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* ComponentsCtrl.java
        
            Purpose:
                
            Description:
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/sys/ComponentsCtrl.java - About 4 hrs to fix

          GenericInterpreter has 36 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public abstract class GenericInterpreter implements Interpreter {
              /** Used by {@link #getFromNamespace} to denote a variable is not defined.
               * @since 2.4.0
               */
              public static final Object UNDEFINED = new Object() {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/scripting/util/GenericInterpreter.java - About 4 hrs to fix

            GridDataLoader has 36 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class GridDataLoader implements DataLoader, Cropper {
                private Grid _grid;
            
                //--DataLoader--//
                public void init(Component owner, int offset, int limit) {
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java - About 4 hrs to fix

              ClassWebResource has 36 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public class ClassWebResource {
                  private static final Logger log = LoggerFactory.getLogger(ClassWebResource.class);
              
                  private final ServletContext _ctx;
                  /** mapping URI including PATH_PREFIX. */
              Severity: Minor
              Found in zweb/src/main/java/org/zkoss/web/util/resource/ClassWebResource.java - About 4 hrs to fix

                Function syncSize has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    syncSize(showScrollbar?: boolean): void {
                        this._checkBarRequired();
                
                        var wgt = this.widget,
                            frozen = wgt.frozen, froenScrollWidth = 0,
                Severity: Major
                Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 4 hrs to fix

                  Function formatDate has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      formatDate(val: DateImpl, fmt?: string, localizedSymbols?: zk.LocalizedSymbols): string {
                          if (!fmt) fmt = 'yyyy/MM/dd';
                  
                          localizedSymbols ??= {
                              DOW_1ST: zk.DOW_1ST,
                  Severity: Major
                  Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 4 hrs to fix

                    Method compareVersion has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static final int compareVersion(int[] v1, int[] v2) {
                            for (int j = 0;; ++j) {
                                if (j == v1.length) {
                                    for (; j < v2.length; ++j) {
                                        if (v2[j] > 0) return -1;
                    Severity: Minor
                    Found in zcommon/src/main/java/org/zkoss/util/Utils.java - About 4 hrs 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 matched has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private static boolean matched(Class[] types, Object[] args, boolean loosely) {
                            if (types.length == args.length) {
                                final Object[] argcvt = loosely ? new Object[args.length]: args;
                                boolean cvted = false;
                                for (int k = args.length;;) {
                    Severity: Minor
                    Found in zcommon/src/main/java/org/zkoss/lang/Classes.java - About 4 hrs 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 jj_add_error_token has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                    Open

                      private void jj_add_error_token(int kind, int pos) {
                        if (pos >= 100) return;
                        if (pos == jj_endpos + 1) {
                          jj_lasttokens[jj_endpos++] = kind;
                        } else if (jj_endpos != 0) {
                    Severity: Minor
                    Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 4 hrs 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 Function has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                    Open

                      final public void Function() throws ParseException {
                     /*@bgen(jjtree) Function */
                        AstFunction jjtn000 = new AstFunction(JJTFUNCTION);
                        boolean jjtc000 = true;
                        jjtree.openNodeScope(jjtn000);Token t0 = null;
                    Severity: Minor
                    Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 4 hrs 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 invoke has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public Object invoke(ELContext context, Object base, Object method,
                                Class<?>[] paramTypes, Object[] params) {
                    
                            if (context == null) {
                                throw new NullPointerException();
                    Severity: Minor
                    Found in zel/src/main/java/org/zkoss/zel/StaticFieldELResolver.java - About 4 hrs 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 parseZk has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private static ZkInfo parseZk(NodeInfo parent, Element el, AnnotationHelper annHelper) throws Exception {
                            if (annHelper.clear())
                                log.warn(message("Annotations are ignored since <zk> doesn't support them", el));
                    
                            final ZkInfo zi = new ZkInfo(parent, null);
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 4 hrs 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 init has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public void init(PageConfig config) {
                            final Execution exec = Executions.getCurrent();
                            if (((ExecutionCtrl) exec).isRecovering()) {
                                final String uuid = config.getUuid(), id = config.getId();
                                if (uuid == null || id == null)
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java - About 4 hrs 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 getComposer has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                    Open

                        @SuppressWarnings("unchecked")
                        public static Composer getComposer(Page page, Object[] ary) throws Exception {
                            if (ary == null || ary.length == 0)
                                return null;
                    
                    
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/MultiComposer.java - About 4 hrs 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

                    Severity
                    Category
                    Status
                    Source
                    Language