Showing 4,841 of 7,782 total issues

Method compare has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    public static final int compare(final Object obj0, final Object obj1)
            throws ELException {
        if (obj0 == obj1 || equals(obj0, obj1)) {
            return 0;
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java - About 6 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 prepare has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private void prepare(Object o, final int begin) {
        if (begin > 0 && (o instanceof List)) {
            final List l = (List) o;
            final int size = l.size();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 6 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 getLoadBindingsPerProperty has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    private void getLoadBindingsPerProperty(Collection<TrackerNode> nodes, String prop,
            LinkedHashSet<LoadBinding> bindings, LinkedHashSet<Object> kidbases, Set<TrackerNode> visited) {
        if (".".equals(prop)) { //all base object
            for (TrackerNode node : nodes) {
                getLoadBindings0(node, bindings, kidbases, visited);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 6 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 parse0 has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    private static void parse0(Context ctx, Node parent, int from, int to)
            throws DspException, IOException, XelException {
        boolean esc = false;
        final StringBuffer sb = new StringBuffer(512);
        for (int j = from; j < to; ++j) {
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 6 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 _scrlIntoView has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

function _scrlIntoView(outer: HTMLElement | null, inner: HTMLElement | null, info: ScrollIntoViewInfo | undefined, excludeHorizontal: boolean): ScrollIntoViewInfo {
    if (outer && inner) {
        var ooft = zk(outer).revisedOffset(),
            ioft = info ? info.oft : zk(inner).revisedOffset(),
            top = ioft[1] - ooft[1]
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - About 6 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 43 (exceeds 5 allowed). Consider refactoring.
Open

    create(context) {
        function checkTypeSyntax(node: TSESTree.TSTypeAnnotation | TSESTree.TSTypeAssertion | TSESTree.TSAsExpression) {
            if (node.typeAnnotation.type === AST_NODE_TYPES.TSNullKeyword) {
                context.report({
                    node: node,
Severity: Minor
Found in eslint-plugin-zk/src/rules/noNull.ts - About 6 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 coerce has 163 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static Object coerce(Class<?> cls, Object val)
    throws ClassCastException {
        if (cls.isInstance(val))
            return val;

Severity: Major
Found in zcommon/src/main/java/org/zkoss/lang/Classes.java - About 6 hrs to fix

    DesktopCtrl has 47 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public interface DesktopCtrl {
        /** Returns the request queue.
         */
        public RequestQueue getRequestQueue();
    
    
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/sys/DesktopCtrl.java - About 6 hrs to fix

      File ForEachImpl.java has 437 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* ForEachImpl.java
      
          Purpose:
      
          Description:
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 6 hrs to fix

        Method LambdaParameters has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

          final public void LambdaParameters() throws ParseException {
                                                     /*@bgen(jjtree) LambdaParameters */
          AstLambdaParameters jjtn000 = new AstLambdaParameters(JJTLAMBDAPARAMETERS);
          boolean jjtc000 = true;
          jjtree.openNodeScope(jjtn000);
        Severity: Minor
        Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 6 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 mergeSubTree has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            protected void mergeSubTree() {
                List<HtmlShadowElement> children = getChildren();
                if (children == null || children.isEmpty())
                    return; // nothing to do.
                if (_parent != null) {
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 6 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 parse has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            public PageDefinition parse(Document doc, String extension) throws Exception {
                //1. parse the page and import directive if any
                final List<ProcessingInstruction> pis = new LinkedList<ProcessingInstruction>();
                final List<String[]> imports = new LinkedList<String[]>();
                final List<String> impclses = new LinkedList<String>();
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 6 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

        ComponentCtrl has 46 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public interface ComponentCtrl {
            /**
             * For page attached callback, use in {@link #addCallback(String, Callback)}
             */
            public static String AFTER_PAGE_ATTACHED = "afterPageAttached";
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/sys/ComponentCtrl.java - About 6 hrs to fix

          Clients has 46 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class Clients {
              /** Sends an AU response ({@link AuResponse}) to the client.
               * It is the same as <code>response(response.getOverrideKey(), response)</code>.
               *
               * @since 3.0.0
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/util/Clients.java - About 6 hrs to fix

            UiVisualizer has 46 methods (exceeds 20 allowed). Consider refactoring.
            Open

            /*package*/ class UiVisualizer implements Visualizer {
                //    private static final Logger log = LoggerFactory.getLogger(UiVisualizer.class);
            
                /** The parent exec info. */
                private final UiVisualizer _parent;
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.java - About 6 hrs to fix

              Selectbox has 46 methods (exceeds 20 allowed). Consider refactoring.
              Open

              @SuppressWarnings("serial")
              public class Selectbox extends HtmlBasedComponent implements Disable {
              
                  private String _name;
                  private boolean _disabled;
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Selectbox.java - About 6 hrs to fix

                Function fixFlex has 158 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        fixFlex(wgt: zk.Widget): void {
                            let hflexWgt;
                            if (wgt._flexFixed || (!wgt._nvflex && !wgt._nhflex)) { //other vflex/hflex sibliing has done it!
                                delete wgt._flexFixed;
                                return;
                Severity: Major
                Found in zk/src/main/resources/web/js/zk/flex.ts - About 6 hrs to fix

                  Method parseEventExpression has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static Object[] parseEventExpression(Component comp, String evtexpr, Component defaultComp, boolean deferred)
                              throws ComponentNotFoundException {
                          final int j = evtexpr.lastIndexOf('.');
                          final String evtnm;
                          Object target;
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/sys/ComponentsCtrl.java - About 6 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 service has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public void service(HttpServletRequest request, HttpServletResponse response, String path)
                              throws ServletException, java.io.IOException {
                  
                          String resourceCache = Library.getProperty("org.zkoss.zk.WCS.cache");
                          if (resourceCache != null && "false".equalsIgnoreCase(resourceCache))
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/http/WcsExtendlet.java - About 6 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 toHTML has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public String toHTML(PageDefinition pgdef, Page page) {
                          final Evaluator eval = pgdef.getEvaluator();
                          if (_cond != null && !_cond.isEffective(eval, page))
                              return "";
                  
                  
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/HeaderInfo.java - About 6 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