Showing 4,841 of 7,782 total issues

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

    private boolean enableServerPush0(ServerPush sp, boolean enable) {
        if (_sess == null)
            throw new IllegalStateException("Server push cannot be enabled in a working thread");

        final boolean serverPushAlreadyExists = _spush != null;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.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 addResponsesForCreatedPerSiblings has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    private static void addResponsesForCreatedPerSiblings(List<AuResponse> responses, Set<Component> newsibs,
            Map<Component, Set<? extends Component>> croppingInfos) throws IOException {
        final Component parent;
        final Page page;
        {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.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 initRendererIfAny has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    private void initRendererIfAny(Component comp, String attr) {
        final Object installed = comp.getAttribute(BinderCtrl.RENDERER_INSTALLED);
        if (installed != null) { //renderer was set already init
            return;
        }
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.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 setPaginal has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public void setPaginal(Paginal pgi) {
        if (!Objects.equals(pgi, _pgi)) {
            final Paginal old = _pgi;
            _pgi = pgi; //assign before detach paging, since removeChild assumes it

Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.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 setPaginal has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public void setPaginal(Paginal pgi) {
        if (!Objects.equals(pgi, _pgi)) {
            final Paginal old = _pgi;
            _pgi = pgi; //assign before detach paging, since removeChild assumes it

Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.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 setPaginal has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public void setPaginal(Paginal pgi) {
        if (!Objects.equals(pgi, _pgi)) {
            final Paginal old = _pgi;
            _pgi = pgi; // assign before detach paging, since removeChild
            // assumes it
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.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 doProcess has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

function doProcess(cmd: string, data: ({ $u?: string } & zk.Widget | undefined)[]): void { //decoded
    if (!dataNotReady(cmd, data)) {
        if (!zAu.processPhase) {
            zAu.processPhase = cmd;
        }
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - 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 tabbox$mold$ has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

function tabbox$mold$(out) {
    var icon = this.$s('icon'),
        uuid = this.uuid,
        tabscroll = this.isTabscroll(),
        tabs = this.tabs,
Severity: Minor
Found in zul/src/main/resources/web/js/zul/tab/mold/tabbox.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 isRoundingRequired has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    isRoundingRequired(val: string | number, fmt: string, localizedSymbols?: zk.LocalizedSymbols): boolean {
        if (!fmt || val == null || val == '')
            return false;
        
        var useMinsuFmt;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/fmt/numfmt.ts - 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 _escapeQuote has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    _escapeQuote(fmt: string, localizedSymbols: zk.LocalizedSymbols): Efmt {
        //note we do NOT support mixing of quoted and unquoted percent
        var cc, q = -2, shift = 0, ret = '', jdot = -1, purejdot = -1, pure = '', prej = -1,
            validPercent = fmt ? !new RegExp('(\'[' + localizedSymbols.PERCENT + '|' + localizedSymbols.PER_MILL + ']+\')', 'g').test(fmt) : true;
            //note we do NOT support mixing of quoted and unquoted percent|permill
Severity: Minor
Found in zk/src/main/resources/web/js/zk/fmt/numfmt.ts - 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

File ListModelSetProxy.java has 357 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/** ListModelSetProxy.java.

    Purpose:

    Description:
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/proxy/ListModelSetProxy.java - About 4 hrs to fix

    CacheMap has 35 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class CacheMap<K,V> implements Map<K,V>, Cache<K,V>, java.io.Serializable, Cloneable {
        private static final long serialVersionUID = 20070907L;
        //private static final Logger log = LoggerFactory.getLogger(CacheMap.class);
    
        /** The map to store the mappings. */
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/util/CacheMap.java - About 4 hrs to fix

      HtmlPageRenders has 35 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class HtmlPageRenders {
          //    private static final Logger log = LoggerFactory.getLogger(HtmlPageRenders.class);
      
          /** Denotes whether style sheets are generated for this request. */
          private static final String ATTR_LANG_CSS_GENED = "javax.zkoss.zk.lang.css.generated";
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.java - About 4 hrs to fix

        ValidationMessagesImpl has 35 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class ValidationMessagesImpl implements ValidationMessages, Collection<Object>, Serializable {
            //this class implement collection to support empty expression in EL
            private static final long serialVersionUID = 1L;
        
            // null objects
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/impl/ValidationMessagesImpl.java - About 4 hrs to fix

          Column has 35 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class Column extends HeaderElement {
              private String _sortDir = "natural";
              private transient Comparator<?> _sortAsc, _sortDsc;
              private String _sortAscNm = "none";
              private String _sortDscNm = "none";
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Column.java - About 4 hrs to fix

            Method getMethod has 112 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @SuppressWarnings("null")
                public static Method getMethod(Object base, Object property,
                        Class<?>[] paramTypes, Object[] paramValues)
                        throws MethodNotFoundException {
                    if (base == null || property == null) {
            Severity: Major
            Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java - About 4 hrs to fix

              Function exit has 112 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              exit(rootPath) {
                                  let _dir = this.file.opts.filename.replace(/-/g, '_').split('/'),
                                      _jsLoc = _dir.findIndex(x => x === 'js'),
                                      _file = _dir[_dir.length - 1],
                                      _privateVars = new Set(),
              Severity: Major
              Found in babel-plugin-expose-private-functions-and-variables.js - About 4 hrs to fix

                File Treecol.java has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  Method Unary has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    final public void Unary() throws ParseException {
                      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
                      case MINUS:
                        jj_consume_token(MINUS);
                                    AstNegative jjtn001 = new AstNegative(JJTNEGATIVE);
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 4 hrs to fix

                    Method parseItems has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private void parseItems(final PageDefinition pgdef, final NodeInfo parent, Collection items,
                                AnnotationHelper annHelper, boolean bNativeContent) throws Exception {
                            LanguageDefinition parentlang = getLanguageDefinition(parent);
                            if (parentlang == null)
                                parentlang = pgdef.getLanguageDefinition();
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 4 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language