Showing 4,841 of 7,782 total issues

Function format has 146 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    format(fmt: string, val: string, rounding: number, localizedSymbols?: zk.LocalizedSymbols): string {
        if (val == null) return '';
        if (!fmt) return val + '';
        
        if (fmt.startsWith('locale:')) {
Severity: Major
Found in zk/src/main/resources/web/js/zk/fmt/numfmt.ts - About 5 hrs to fix

    SimpleSession has 43 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class SimpleSession implements Session, SessionCtrl {
        private static final Logger log = LoggerFactory.getLogger(SimpleSession.class);
    
        /** The attribute used to hold a set of serializable attributes that are written
         * thru {@link #setAttribute}.
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/http/SimpleSession.java - About 5 hrs to fix

      DialModelScale has 43 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class DialModelScale implements Serializable {
          private DialModel _model;
      
          //data
          private double _value;
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java - About 5 hrs to fix

        Listitem has 43 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class Listitem extends XulElement {
        
            private transient Object _value;
            /** The index in the parent (only for implementation purpose). */
            private int _index = -1; //no parent at beginning
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Listitem.java - About 5 hrs to fix

          File ParamCall.java has 408 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          package org.zkoss.bind.impl;
          
          import java.beans.BeanInfo;
          import java.beans.Introspector;
          import java.beans.PropertyDescriptor;
          Severity: Minor
          Found in zkbind/src/main/java/org/zkoss/bind/impl/ParamCall.java - About 5 hrs to fix

            File Include.java has 408 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              Method create has 144 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public void create() {
                      List<DefaultTreeNode<TreeObject>> folderNodes = new ArrayList<DefaultTreeNode<TreeObject>>();
                      List<DefaultTreeNode<TreeObject>> selection = new ArrayList<DefaultTreeNode<TreeObject>>();
                      List<DefaultTreeNode<TreeObject>> objectNodes = new ArrayList<DefaultTreeNode<TreeObject>>();
                      DefaultTreeNode<TreeObject> object = null;

                Method invoke has a Cognitive Complexity of 38 (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/BeanELResolver.java - About 5 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 parseClientConfig has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static void parseClientConfig(Configuration config, Element conf) {
                        Integer v = parseInteger(conf, "processing-prompt-delay", POSITIVE_ONLY);
                        if (v != null)
                            config.setProcessingPromptDelay(v.intValue());
                
                
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.java - About 5 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 parseComponentDirective has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void parseComponentDirective(PageDefinition pgdef, ProcessingInstruction pi, Map<String, String> params)
                            throws Exception {
                        final String name = params.remove("name");
                        noELnorEmpty("name", name, pi);
                
                
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 5 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 removeEventListener has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                    public boolean removeEventListener(String evtnm, EventListener<? extends Event> listener) {
                        if (evtnm == null || listener == null)
                            throw new IllegalArgumentException("null");
                
                        if (_auxinf != null && _auxinf.listeners != null) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 5 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 execUpdate has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void execUpdate(Execution exec, List<AuRequest> requests, AuWriter out) throws IOException {
                        if (requests == null)
                            throw new IllegalArgumentException();
                        //        assert ExecutionsCtrl.getCurrentCtrl() == null:
                        //            "Impossible to re-activate for update: old="+ExecutionsCtrl.getCurrentCtrl()+", new="+exec;
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 5 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 save has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void save(BindContext ctx) {
                        final Binder binder = getBinder();
                        final Component comp = getComponent(); //ctx.getComponent();
                        final Form form = getFormBean(ctx);
                
                
                Severity: Minor
                Found in zkbind/src/main/java/org/zkoss/bind/impl/SaveFormBindingImpl.java - About 5 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 doValidate has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected boolean doValidate(Component comp, String command, Event evt, BindContext ctx, Set<Property> notifys) {
                        final Set<Property> validates = new HashSet<Property>();
                        try {
                            if (_log.isDebugEnabled()) {
                                _log.debug("doValidate  comp=[{}],command=[{}],evt=[{}],context=[{}]", comp, command, evt, ctx);
                Severity: Minor
                Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 5 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 getBrowser has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static Browser getBrowser() {
                        Double number = Servlets.getBrowser(ServletFns.getCurrentRequest(), "ff");
                        if (number != null && number >= 3.6)
                            return Browser.Firefox;
                        number = Servlets.getBrowser(ServletFns.getCurrentRequest(), "ie");
                Severity: Minor
                Found in zweb/src/main/java/org/zkoss/web/fn/ThemeFns.java - About 5 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 exports has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports = function ({types: t}) {
                
                    /**
                     * @internal
                     * Convert directory string array to MemberExpression.
                Severity: Minor
                Found in babel-plugin-expose-private-functions-and-variables.js - About 5 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 tsdocValidation.ts has 405 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { AST_TOKEN_TYPES, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
                // import { createRule, getParserServices } from '../util';
                import {
                    DocBlock,
                    DocComment,
                Severity: Minor
                Found in eslint-plugin-zk/src/rules/tsdocValidation.ts - About 5 hrs to fix

                  UiEngine has 42 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public interface UiEngine {
                      /** Starts the engine.
                       */
                      public void start(WebApp wapp);
                  
                  
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/sys/UiEngine.java - About 5 hrs to fix

                    ForEachImpl has 42 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class ForEachImpl implements ForEach {
                        private final EvaluatorRef _evalr;
                        private final Page _page;
                        private final Component _comp;
                        private final ExValue[] _expr;
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 5 hrs to fix

                      LayoutRegion has 42 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public abstract class LayoutRegion extends XulElement {
                      
                          private static final Logger log = LoggerFactory.getLogger(LayoutRegion.class);
                      
                          private String _border = "normal";
                      Severity: Minor
                      Found in zul/src/main/java/org/zkoss/zul/LayoutRegion.java - About 5 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language