Showing 4,841 of 7,782 total issues

Grid has 90 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Grid extends MeshElement {
    private static final Logger log = LoggerFactory.getLogger(Grid.class);
    private static final long serialVersionUID = 20091111L;

    private static final String ATTR_ON_INIT_RENDER_POSTED = "org.zkoss.zul.Grid.onInitLaterPosted";
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Grid.java - About 1 day to fix

    Method setModel has a Cognitive Complexity of 85 (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/Listbox.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 transformer has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function transformer(file, api) {
        const j = api.jscodeshift;
        const root = j(file.source);
        const aliases = new Map();
    
    
    Severity: Minor
    Found in eslint-plugin-zk/src/transform.js - 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 formatDate has a Cognitive Complexity of 84 (exceeds 5 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: Minor
    Found in zul/src/main/resources/web/js/zul/db/datefmt.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

    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

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

      private int jjMoveNfa_1(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

              Method parseLang has 324 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

                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

                  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

                    File DefinitionLoaders.java has 692 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 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

                      Severity
                      Category
                      Status
                      Source
                      Language