Showing 4,841 of 7,782 total issues

File ReflectionUtil.java has 402 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java - About 5 hrs to fix

    Function _mouseDown has 141 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _mouseDown(evt: zk.Event): void {
            var cls = evt.target.className,
                index = cls.lastIndexOf('-'),
                key = cls.substring(index + 1),
                $drag = jq(this.edrag);
    Severity: Major
    Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 5 hrs to fix

      Method setContent has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          public final Object setContent(Object obj) {
              if (obj instanceof Item) {
                  getChildren().add((Item)obj);
                  return null; //done
              }
      Severity: Minor
      Found in zcommon/src/main/java/org/zkoss/idom/Element.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 coerceToTypeForSetValue has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          protected static final Object coerceToTypeForSetValue(final Object obj,
                  Class<?> type) throws ELException {
              if (type == null || Object.class.equals(type) ||
                      (obj != null && type.isAssignableFrom(obj.getClass()))) {
                  return obj;
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.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 unwrap has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          public NameSpace unwrap(Scope scope) {
              if (_bshns == null) {
                  _bshns = BSHInterpreter.getInterpreter(scope).newNS(scope);
                  if (_vars != null) {
                      for (Map.Entry<String, Object> me : _vars.entrySet()) {
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/scripting/bsh/NSWrapSR.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 setSort has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          public void setSort(String type) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
              if (type == null)
                  return;
              if (type.startsWith("client")) {
                  setSortAscending(type);
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Column.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 beforeChildAdded has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          public void beforeChildAdded(Component newChild, Component refChild) {
              if (newChild instanceof Caption) {
                  if (_caption != null && _caption != newChild)
                      throw new UiException("Only one caption is allowed: " + this);
              } else if (refChild instanceof Caption) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Panel.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 onListDataChange has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          @SuppressWarnings("rawtypes")
          private void onListDataChange(ListDataEvent event) {
              int type = event.getType();
              // ZK-4549: should ignore before handling sorting
              if (getAttribute(Attributes.BEFORE_MODEL_ITEMS_RENDERED) != null
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Listbox.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 _eval has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

      function _eval(wgt: zk.Widget, s: string | null, args: unknown): string | null {
          if (s)
              for (var j = 0, k: number, l: number, t: string, last = s.length - 1, s2: string | undefined; ;) {
                  k = s.indexOf('#{', j);
                  if (k < 0) {
      Severity: Minor
      Found in zk/src/main/resources/web/js/zk/zuml/Parser.ts - 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 B65_ZK_2021_Dictionary.java has 397 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package org.zkoss.zktest.test2;
      
      public class B65_ZK_2021_Dictionary {
          static String[] dictionary = { "abacus", "abase", "abate", "abbess", "abbey", "abbot", "abdicate", "abdomen", "abdominal", "abduction", "abed", "aberrant", "aberration", "abet", "abeyance",
                  "abhor", "abhorrence", "abhorrent", "abidance", "ability", "abject", "abjure", "able-bodied", "ablution", "abnegate", "abnormal", "abominable", "abominate", "abomination", "aboriginal",

        File ComponentInfo.java has 397 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* ComponentInfo.java
        
            Purpose:
                
            Description:
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ComponentInfo.java - About 5 hrs to fix

          Function _parseConfig has 138 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              const _parseConfig = function _parseConfig() {
                    let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
                    if (CONFIG && CONFIG === cfg) {
                      return;
                    }
          Severity: Major
          Found in zk/src/main/resources/web/js/zk/ext/purify.js - About 5 hrs to fix

            File Panel.java has 396 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              Rows has 41 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public class Rows extends XulElement {
                  private int _visibleItemCount;
              
                  private transient List<int[]> _groupsInfo;
                  private transient List<Group> _groups;
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 5 hrs to fix

                File B85_ZK_3733_FoodData.java has 394 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                package org.zkoss.zktest.test2;
                
                import java.io.Serializable;
                import java.util.ArrayList;
                import java.util.List;
                Severity: Minor
                Found in zktest/src/main/java/org/zkoss/zktest/test2/B85_ZK_3733_FoodData.java - About 5 hrs to fix

                  Method parse has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public Object parse(Reader in, ContainerFactory containerFactory) throws IOException, ParseException{
                          reset(in);
                          LinkedList statusStack = new LinkedList();
                          LinkedList valueStack = new LinkedList();
                          
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/json/parser/JSONParser.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 myGetCloseMethod has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private static final
                      Method myGetCloseMethod(final Class<?> cls, final String name,
                      final Class<?>[] argTypes, final boolean bySubclass)
                      throws NoSuchMethodException {
                  //        assert argTypes != null: "Caller shall handle null";
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/lang/Classes.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 toString has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static final String toString(Object o) {
                          if (o == null) return null;
                          if (o instanceof Date) return DateFormats.format((Date)o, false);
                          if (o instanceof Class) {
                              final Class cls = (Class)o;
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/lang/Objects.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 load0 has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private static void load0() throws java.io.IOException {
                          final XMLResourcesLocator locator = Utils.getXMLResourcesLocator();
                  
                          //1. parse config.xml
                          final ConfigParser parser = new ConfigParser();
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.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 setId has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public void setId(String id) {
                          if (id == null)
                              id = "";
                          if (!id.equals(_id)) {
                              final boolean rawId = this instanceof RawId;
                  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

                  Severity
                  Category
                  Status
                  Source
                  Language