Showing 7,777 of 7,777 total issues

HtmlBasedComponent has 96 methods (exceeds 20 allowed). Consider refactoring.
Open

public abstract class HtmlBasedComponent extends AbstractComponent {
    /** The ZK CSS class. */
    protected String _zclass;
    /** The prolog content that shall be generated before real content. */
    private String _prolog;
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 1 day to fix

    Method load has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

        public final static void load(Map<? super String, ? super String> map, InputStream sm, String charset,
        boolean caseInsensitive) throws IOException {
            final PushbackInputStream pis = new PushbackInputStream(sm, 3);
            if (charset == null || charset.startsWith("UTF")) {
                final byte[] ahead = new byte[3];
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/util/Maps.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 addByRawValueInV6 has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

        private void addByRawValueInV6(String annotName, String rval,
                Location loc) {
            final Map<String, String[]> attrs = new LinkedHashMap<String, String[]>(
                    4);
            final int len = rval.length();
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/impl/AnnotationHelper.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 91 (exceeds 5 allowed). Consider refactoring.
    Open

        protected void tieValue(ELContext elCtx, Object base, Object property, Object value, boolean allownotify) {
            //in order to support more complex case, ex: .stream().filter(x -> x.contains(vm.value))
            final BindELContext ctx;
            ELContext ec = ((EvaluationContext) elCtx).getELContext();
            if (ec instanceof BindELContext)
    Severity: Minor
    Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.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 Servlets.java has 771 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* Servlets.java
    
        Purpose:
        Description:
        History:
    Severity: Major
    Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 1 day to fix

      Method equals has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
      Open

          public static final boolean equals(Object a, Object b) {
              if (a == b || (a != null && b != null && a.equals(b)))
                  return true;
              if ((a instanceof BigDecimal) && (b instanceof BigDecimal))
                  return ((BigDecimal)a).compareTo((BigDecimal) b) == 0;
      Severity: Minor
      Found in zcommon/src/main/java/org/zkoss/lang/Objects.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 indexOf has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
      Open

          public static final int indexOf(Object o, Object element) {
              if (o instanceof String) {
                  return element instanceof String ?
                      ((String)o).indexOf((String)element): -1;
              } else if (o instanceof Collection) {
      Severity: Minor
      Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.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 create has 350 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          create(context) {
              const tsdocConfig = getTsdocConfig();
              if (!tsdocConfig) {
                  return {};
              }
      Severity: Major
      Found in eslint-plugin-zk/src/rules/tsdocValidation.ts - About 1 day to fix

        File TrackerImpl.java has 749 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* TrackerImpl.java
        
            Purpose:
                
            Description:
        Severity: Major
        Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 1 day to fix

          Method lastIndexOf has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
          Open

              public static final int lastIndexOf(Object o, Object element) {
                  if (o instanceof String) {
                      return element instanceof String ?
                          ((String)o).lastIndexOf((String)element): -1;
                  } else if (o instanceof List) {
          Severity: Minor
          Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.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

          Combobox has 91 methods (exceeds 20 allowed). Consider refactoring.
          Open

          @SuppressWarnings("serial")
          public class Combobox extends Textbox {
              public static final String ICON_SCLASS = "z-icon-caret-down";
          
              private static final Logger log = LoggerFactory.getLogger(Combobox.class);
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/Combobox.java - About 1 day to fix

            File Components.java has 743 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              File mount.ts has 742 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

                Method Unary has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
                Open

                  final public void Unary() throws ParseException {
                    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
                    case MINUS:
                      jj_consume_token(MINUS);
                                  AstNegative jjtn001 = new AstNegative(JJTNEGATIVE);
                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

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

                public interface Execution extends Scope {
                    /** Returns the desktop associated with this execution.
                     * Each execution is against exactly one desktop.
                     */
                    public Desktop getDesktop();
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/Execution.java - About 1 day to fix

                  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_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
                      Severity
                      Category
                      Status
                      Source
                      Language