Showing 4,834 of 7,774 total issues

File PageImpl.java has 1044 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* PageImpl.java

    Purpose:
        
    Description:
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java - About 2 days to fix

    Method Multiplication has a Cognitive Complexity of 127 (exceeds 5 allowed). Consider refactoring.
    Open

      final public void Multiplication() throws ParseException {
        Unary();
        label_13:
        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 2 days 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 a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
    Open

        public static Object coerce(Class<?> cls, Object val)
        throws ClassCastException {
            if (cls.isInstance(val))
                return val;
    
    
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/lang/Classes.java - About 2 days 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 Classes.java has 1005 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* Classes.java
    
    
        Purpose: Utilities to handle Class
        Description:
    Severity: Major
    Found in zcommon/src/main/java/org/zkoss/lang/Classes.java - About 2 days to fix

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

          create(context) {
              const tsdocConfig = getTsdocConfig();
              if (!tsdocConfig) {
                  return {};
              }
      Severity: Minor
      Found in eslint-plugin-zk/src/rules/tsdocValidation.ts - About 2 days 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 initDataListener has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
      Open

          private void initDataListener() {
              if (INVALIDATE_THRESHOLD == -1) {
                  INVALIDATE_THRESHOLD = Utils.getIntAttribute(this, "org.zkoss.zul.invalidateThreshold", 10, true);
              }
              if (_dataListener == null)
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Combobox.java - About 2 days 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 114 (exceeds 5 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: Minor
      Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 2 days 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

      PageImpl has 117 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class PageImpl extends AbstractPage implements java.io.Serializable {
          private static final Logger log = LoggerFactory.getLogger(PageImpl.class);
          private static final long serialVersionUID = 20110726L;
      
          /** The component that includes this page, or null if not included. */
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java - About 2 days to fix

        File WpdExtendlet.java has 910 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* WpdExtendlet.java
        
            Purpose:
        
            Description:
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.java - About 2 days to fix

          Function fixFlex has a Cognitive Complexity of 109 (exceeds 5 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: Minor
          Found in zk/src/main/resources/web/js/zk/flex.ts - About 2 days 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 purify.js has 896 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */
          
          (function (global, factory) {
            typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
            typeof define === 'function' && define.amd ? define(factory) :
          Severity: Major
          Found in zk/src/main/resources/web/js/zk/ext/purify.js - About 2 days to fix

            Method insertBefore has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring.
            Open

                public boolean insertBefore(Component newChild, Component refChild) {
                    if (newChild instanceof Listitem) {
                        final boolean isReorder = newChild.getParent() == this;
                        //bug #3051305: Active Page not update when drag & drop item to the end
                        if (isReorder) {
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 2 days 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 redraw has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring.
            Open

                public void redraw(Writer out) throws java.io.IOException {
                    //Note: _tag == null can NOT be handled specially
                    final Execution exec = Executions.getCurrent();
                    final boolean root = getParent() == null && (getPage().isComplete()
                            || (exec != null && "complete".equals(ExecutionsCtrl.getPageRedrawControl(exec))));
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/HtmlNativeComponent.java - About 2 days 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 Combobox.java has 855 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* Combobox.java
            
                Purpose:
            
                Description:
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Combobox.java - About 2 days to fix

              Method write has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static void write(HttpServletRequest request, HttpServletResponse response, Media media, boolean download,
                          boolean repeatable) throws IOException {
                      //2012/03/09 TonyQ: ZK-885 Iframe with PDF stop works in IE 8 when we have Accept-Ranges = bytes.
              
                      if (!Servlets.isBrowser(request, "ie")) {
              Severity: Minor
              Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.java - About 2 days 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 HtmlPageRenders.java has 845 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* HtmlPageRenders.java
              
                  Purpose:
                      
                  Description:
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.java - About 2 days to fix

                Method resolveVariable0 has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected Object resolveVariable0(Object self, XelContext ctx, Object base, Object onm) {
                        if (base != null) {
                            Object o = ((ExecutionCtrl) _exec).getExtraXelVariable(ctx, base, onm);
                            if (o != null)
                                return o;
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/xel/impl/ExecutionResolver.java - About 2 days 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 format has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring.
                Open

                    format(fmt: string, val: string, rounding: number, localizedSymbols?: zk.LocalizedSymbols): string {
                        if (val == null) return '';
                        if (!fmt) return val + '';
                        
                        if (fmt.startsWith('locale:')) {
                Severity: Minor
                Found in zk/src/main/resources/web/js/zk/fmt/numfmt.ts - About 2 days 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

                UiEngineImpl has 103 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class UiEngineImpl implements UiEngine {
                    /*package*/ static final Logger log = LoggerFactory.getLogger(UiEngineImpl.class);
                
                    /** The Web application this engine belongs to. */
                    private WebApp _wapp;
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 1 day to fix

                  Method unescape has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
                  Open

                      static String unescape(final String text) {
                  
                          if (text == null) {
                              return null;
                          }
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.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

                  Severity
                  Category
                  Status
                  Source
                  Language