Showing 4,841 of 7,782 total issues

LabelImageElement has 44 methods (exceeds 20 allowed). Consider refactoring.
Open

public abstract class LabelImageElement extends LabelElement {
    private AuxInfo _auxinf;

    protected LabelImageElement() {
    }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java - About 6 hrs to fix

    File WebManager.java has 415 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      File GridDataLoader.java has 415 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        Method parse has 148 lines of code (exceeds 25 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: Major
        Found in zcommon/src/main/java/org/zkoss/json/parser/JSONParser.java - About 5 hrs to fix

          Method Or has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

            final public void Or() throws ParseException {
              And();
              label_7:
              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 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 And has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

            final public void And() throws ParseException {
              Equality();
              label_8:
              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 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 NonLiteral has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

            final public void NonLiteral() throws ParseException {
              if (jj_2_6(5)) {
                LambdaExpressionOrInvocation();
              } else {
                switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          Severity: Minor
          Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.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 coerceToType has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

              public static final Object coerceToType(final Object obj,
                      Class<?> type) throws ELException {
          
                  if (type == null || Object.class.equals(type) ||
                          (obj != null && type.isAssignableFrom(obj.getClass()))) {
          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 parseDesktopConfig has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

              private static void parseDesktopConfig(Configuration config, Element conf) throws Exception {
                  //theme-uri
                  for (Iterator<Element> it = conf.getElements("theme-uri").iterator(); it.hasNext();) {
                      final Element el = (Element) it.next();
                      final String uri = el.getText(true);
          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 imports has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

              public void imports(PageDefinition pgdef, String[] directives) {
                  if (directives == null || contains(directives, "import"))
                      _clsresolver.addAll(pgdef._clsresolver);
          
                  if (pgdef._initdefs != null && (directives == null || contains(directives, "init")))
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.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 getCommandMethod has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

              private Method getCommandMethod(Class<?> clz, String command, CommandMethodInfoProvider cmdInfo,
                      Map<Class<?>, Map<String, CachedItem<Method>>> cache, int commandParamCount, boolean isGlobal) {
                  Map<String, CachedItem<Method>> methods;
                  Method matchedMethodWithoutAnno = null;
                  CachedItem<Method> method = null;
          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 setSelectAll has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

                  public void setSelectAll(boolean selectAll) {
                      if (selectAll) {
                          boolean isGroupSelectable = model.isGroupSelectable();
                          List<E> all = new LinkedList<>();
                          for (int i = 0, j = model.getGroupCount(); i < j; i++) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/AbstractGroupsModel.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 39 (exceeds 5 allowed). Consider refactoring.
          Open

              public void beforeChildAdded(Component newChild, Component refChild) {
                  if (newChild instanceof Listitem) {
                      if (newChild instanceof Listgroupfoot) {
                          if (!hasGroup())
                              throw new UiException("Listgroupfoot cannot exist alone, you have to add a Listgroup first");
          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

          Method doListDataChange has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

              public void doListDataChange(ListDataEvent event) {
                  if (INVALIDATE_THRESHOLD == -1) {
                      INVALIDATE_THRESHOLD = Utils.getIntAttribute(this.getOwner(), "org.zkoss.zul.invalidateThreshold", 10,
                              true);
                  }
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.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 clearCSSFlex has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

                  clearCSSFlex(wgt: zk.Widget, o: FlexOrient, clearAllSiblings?: boolean): void {
                      if (!wgt._cssFlexApplied) return;
          
                      const pwgt = wgt.parent;
                      if (!pwgt) return;
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/flex.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

          Function syncSize has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

              syncSize(showScrollbar?: boolean): void {
                  this._checkBarRequired();
          
                  var wgt = this.widget,
                      frozen = wgt.frozen, froenScrollWidth = 0,
          Severity: Minor
          Found in zul/src/main/resources/web/js/zul/Scrollbar.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

          Function create has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

          function create(parent: zk.Widget | undefined, wi: WidgetInfo, ignoreDom?: boolean): zk.Widget {
              let nm;
              var wgt: zk.Widget, stub: boolean,
                  type = wi[0],
                  uuid = wi[1],
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/mount.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

          Function _parseTextToArray has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

          function _parseTextToArray(txt: string, fmt: string): string[] | undefined {
              //ZK-5423
              var literals = extractLiteral(fmt); //extract literal token from format
              //remove literal from format and text
              fmt = fmt.replace(/'.*?'/g, ' ');  //remove any string enclosed by single quotes
          Severity: Minor
          Found in zul/src/main/resources/web/js/zul/db/datefmt.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

          Function _fixMinFlex has 147 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function _fixMinFlex(isVflex?): ((wgt: zk.Widget, wgtn: HTMLElement, o: FlexOrient,
                                            min?: number) => number) {
              let flexsz: string, sizePos: string, flex: string, offsetPos: string, marginPos: string, maxFlexPos: string, sumFlexPos: string,
                  index: number, contentPos: string;
              if (isVflex) {
          Severity: Major
          Found in zk/src/main/resources/web/js/zk/flex.ts - About 5 hrs to fix

            Method loadSymbols has 146 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static Map loadSymbols(Locale locale) {
                    WaitLock lock = null;
                    for (;;) {
                        final Object o;
                        synchronized (_symbols) {
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Datebox.java - About 5 hrs to fix
              Severity
              Category
              Status
              Source
              Language