Showing 7,777 of 7,777 total issues

Method jjMoveNfa_2 has 335 lines of code (exceeds 25 allowed). Consider refactoring.
Open

private int jjMoveNfa_2(int startState, int curPos)
{
   int startsAt = 0;
   jjnewStateCnt = 30;
   int i = 1;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 1 day to fix

    Function setDocument has 333 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    setDocument = Sizzle.setDocument = function( node ) {
        var hasCompare, subWindow,
            doc = node ? node.ownerDocument || node : preferredDoc;
    
        // Return early if doc is invalid or already selected
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 day to fix

      Method setModel has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
      Open

          public void setModel(ListModel<?> model) {
              //ZK-3514: speed up
              if (_model != null && _model != model) {
                  int threshold = Utils.getIntAttribute(this, "org.zkoss.zul.invalidateThreshold", 10, true);
                  int diff = Math.abs((model != null ? model.getSize() : 0) - _model.getSize());
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Grid.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

      File Scrollbar.ts has 709 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* Scrollbar.ts
      
          Purpose:
      
          Description:
      Severity: Major
      Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 1 day to fix

        Component has 86 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public interface Component extends Scope, java.io.Serializable, Cloneable {
            /** Returns the widget class (a.k.a., the widget type), or null
             * if not available.
             * The widget class is a JavaScript class, including the package name.
             * For example, "zul.wnd.Window".
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/ui/Component.java - About 1 day to fix

          File UiVisualizer.java has 705 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

            Method renderValue has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
            Open

                private String renderValue(Object value) {
                    if (value == null || value instanceof String) {
                        return renderValue((String) value);
                    }
                    if (value instanceof Date) {
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.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 parseLang has 321 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static void parseLang(Document doc, Locator locator, URL url, boolean addon) throws Exception {
                    final Element root = doc.getRootElement();
                    final String lang = IDOMs.getRequiredElementValue(root, "language-name");
                    final LanguageDefinition langdef;
                    final Device device;
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.java - About 1 day to fix

              InputElement has 85 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public abstract class InputElement extends XulElement implements Constrainted, Readonly, Disable {
                  private static final Logger log = LoggerFactory.getLogger(InputElement.class);
              
                  static {
                      addClientEvent(InputElement.class, Events.ON_CHANGE, CE_IMPORTANT | CE_REPEAT_IGNORE);
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/impl/InputElement.java - About 1 day to fix

                Method Math has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
                Open

                  final public void Math() throws ParseException {
                    Multiplication();
                    label_12:
                    while (true) {
                      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.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 tieValue has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void tieValue(Object comp, Object base, Object script, Object propName, Object value, Object basePath) {
                        if (value instanceof IndirectBinding) {
                            value = ((IndirectBinding) value).getValue(null);
                        }
                        if (base == null) { //track from component
                Severity: Minor
                Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.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 lookup has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static Template lookup(Component comp, Component base, String name, Component compBase,
                            boolean excludeBase) {
                        if (comp == null)
                            return null;
                        Template template = (excludeBase && comp == base) ? null : comp.getTemplate(name);
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/Templates.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 browserInfo has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static void browserInfo(Map<String, Object> zk, String ua) {
                        if (ua != null) {
                            // ZK-1822: In locale Turkish, it can prevent 'I'.toLowerCase becomes 'i' without dot.
                            ua = ua.toLowerCase(Locale.ENGLISH);
                            if (_clientId != null) {
                Severity: Minor
                Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.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 _mouseDown has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
                Open

                    _mouseDown(evt: JQuery.MouseDownEvent<never, never, HTMLElement>): void {
                        if (this._pressTimer) {
                            clearInterval(this._pressTimer);
                            this._pressTimer = undefined;
                        }
                Severity: Minor
                Found in zul/src/main/resources/web/js/zul/Scrollbar.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 DefinitionLoaders.java has 688 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  Method getMethod has a Cognitive Complexity of 78 (exceeds 5 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: Minor
                  Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.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

                  File AbstractTreeModel.java has 684 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

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

                    PageDefinition has 82 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class PageDefinition implements NodeInfo {
                        /** A list of a children ({@link NodeInfo}). */
                        private final List<NodeInfo> _children = new LinkedList<NodeInfo>();
                        private final LanguageDefinition _langdef;
                        private final Locator _locator;
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 1 day to fix

                      JQZK has 82 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      export class JQZK {
                          /**
                           * The associated instance of {@link JQZK.jq}, the object returned by `jq(...)`.
                           */
                          declare jq: JQuery;
                      Severity: Major
                      Found in zk/src/main/resources/web/js/zk/dom.ts - About 1 day to fix

                        File ConfigParser.java has 675 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /* ConfigParser.java
                        
                            Purpose:
                                
                            Description:
                        Severity: Major
                        Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.java - About 1 day to fix
                          Severity
                          Category
                          Status
                          Source
                          Language