Showing 4,841 of 7,782 total issues

File EventProcessingThreadImpl.java has 345 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* EventProcessingThreadImpl.java

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

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

        public void write(int b) throws IOException {
            if (_type != 0) {
                if (!"UTF-8".equals(_charset) || (b & 0xc0) == 0x80) {
                    _bs[_cnt ++] = (byte)b;
                    if (_cnt == _type) { //complete
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/io/WriterOutputStream.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 jjStopStringLiteralDfa_2 has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    private final int jjStopStringLiteralDfa_2(int pos, long active0)
    {
       switch (pos)
       {
          case 0:
    Severity: Minor
    Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.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 jjStopStringLiteralDfa_1 has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    private final int jjStopStringLiteralDfa_1(int pos, long active0)
    {
       switch (pos)
       {
          case 0:
    Severity: Minor
    Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.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 toString has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        public String toString() {
            if (_type == null && _id == null && _classes.isEmpty() && _pseudoClasses.isEmpty() && _attributes.isEmpty()
                    && _pseudoElements.isEmpty())
                return "*";
    

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

        /*package*/ static final void write(java.io.ObjectOutputStream s, AbstractComponent comp,
                Map<String, List<EventListenerInfo>> listeners) throws IOException {
            if (listeners != null) {
                final Logger logio = Serializables.logio;
                final boolean debug = logio.isDebugEnabled();
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/EventListenerInfo.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 execCreateChild0 has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        private static Component execCreateChild0(CreateInfo ci, Component parent, ComponentInfo childInfo,
                String replaceableText, Component insertBefore) {
            Composer composer = childInfo.resolveComposer(ci.page, parent);
            ComposerExt composerExt = null;
            boolean bPopComposer = false;
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 createProxyIfAny has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        @SuppressWarnings({ "unchecked", "rawtypes" })
        public static <T> T createProxyIfAny(T origin, Annotation[] annotations) {
            if (origin == null)
                return null;
            if (origin instanceof FormProxyObject) {
    Severity: Minor
    Found in zkbind/src/main/java/org/zkoss/bind/proxy/ProxyHelper.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 readMethod has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

            private int readMethod(TypeCollector classVisitor, char[] c, int u) {
                int v;
                int w;
                int j;
                String attrName;

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

        /*package*/ void fixGroupIndex(int j, int to, boolean infront) {
            int realj = getRealIndex(j);
            if (realj < 0) {
                realj = 0;
            }
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Rows.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 fixItemIndices has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        /* package */void fixItemIndices(int j, int to, boolean infront) {
            int realj = getRealIndex(j);
            if (realj < 0) {
                realj = 0;
            }
    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

    Method render has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        public void render(ActionContext ac, boolean nested) throws DspException, IOException {
            //at least items or end must be specified
            if (!nested || (_itemsSpecified && _items == null) || (_endSpecified && _end < _beg)
                    || (!_itemsSpecified && !_endSpecified) || !isEffective())
                return;
    Severity: Minor
    Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.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 grid$mold$ has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    function grid$mold$(out) {
        let uuid = this.uuid,
            innerWidth = zUtl.encodeXML(this.getInnerWidth()),
            wdAttr = innerWidth === '100%' ? ' width="100%"' : '', //bug#3183182
            wdStyle = innerWidth !== '100%' ? 'width:' + innerWidth : '',
    Severity: Minor
    Found in zul/src/main/resources/web/js/zul/grid/mold/grid.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 mtBL0 has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    function mtBL0(): void {
        for (; ;) {
            if (_crInfBL0.length)
                return; //another page started
    
    
    Severity: Minor
    Found in zk/src/main/resources/web/js/zk/mount.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 syncSize has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        syncSize(opts?: Record<string, unknown>): void {
            if (opts) {
                this.opts = zk.copy(this.opts, opts);
            }
            this.edrag.style.display = '';
    Severity: Minor
    Found in zul/src/main/resources/web/js/zul/WScroll.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

    Method unescape has 106 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static String unescape(final String text) {
    
            if (text == null) {
                return null;
            }
    Severity: Major
    Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 4 hrs to fix

      Method getValue has 106 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public Object getValue(EvaluationContext ctx)
                  throws ELException {
      
              FunctionMapper fnMapper = ctx.getFunctionMapper();
      
      Severity: Major
      Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstFunction.java - About 4 hrs to fix

        Function tree has 106 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function tree(d, i) {
            var nodes = hierarchy.call(this, d, i),
                root = nodes[0];
        
            function firstWalk(node, previousSibling) {
        Severity: Major
        Found in zktest/src/main/webapp/js/d3.layout.js - About 4 hrs to fix

          File JSCumulativeContentRenderer.java has 342 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

            Method getResponses has 105 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public List<AuResponse> getResponses(Collection<Component> renderedComps) throws IOException {
                    _ending = true; //no more modifying UI (invalidate/addSmartUpdate...)
            
                    /*        if (log.finerable())
                                log.finer("ei: "+this+"\nInvalidated: "+_invalidated+"\nSmart Upd: "+_smartUpdated
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.java - About 4 hrs to fix
              Severity
              Category
              Status
              Source
              Language