Showing 4,841 of 7,782 total issues

Function getInputSequences has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    getInputSequences: function(a) {
        var b = [],
            c = [],
            c = a.match(/([0-9]{13,44})/g);
        if (null == c) c = [];
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 1 hr to fix

    Function apportion has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function apportion(node, previousSibling, ancestor) {
          if (previousSibling) {
            var vip = node,
                vop = node,
                vim = previousSibling,
    Severity: Minor
    Found in zktest/src/main/webapp/js/d3.layout.js - About 1 hr to fix

      Function mightThrow has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                                      mightThrow = function() {
                                          var returned, then;
      
                                          // Support: Promises/A+ section 2.3.3.3.3
                                          // https://promisesaplus.com/#point-59
      Severity: Minor
      Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

        Function boxModelAdjustment has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
            var i = dimension === "width" ? 1 : 0,
                extra = 0,
                delta = 0;
        
        
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

          Function isMomentInputObject has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function isMomentInputObject(input) {
                  var objectTest = isObject(input) && !isObjectEmpty(input),
                      propertyTest = false,
                      properties = [
                          'years',
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

            Function bubble has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function bubble() {
                    var milliseconds = this._milliseconds,
                        days = this._days,
                        months = this._months,
                        data = this._data,
            Severity: Minor
            Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

              Function doProcess has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function doProcess(cmd: string, data: ({ $u?: string } & zk.Widget | undefined)[]): void { //decoded
                  if (!dataNotReady(cmd, data)) {
                      if (!zAu.processPhase) {
                          zAu.processPhase = cmd;
                      }
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/au.ts - About 1 hr to fix

                Function ensureTsdocHeaderNewline has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function ensureTsdocHeaderNewline(tsdoc: TextRange): void {
                            const startOfDoc = sourceCode.getLocFromIndex(tsdoc.pos);
                            if (startOfDoc.line === sourceCode.getLocFromIndex(tsdoc.end).line) {
                                return; // TSDoc is single line.
                            }
                Severity: Minor
                Found in eslint-plugin-zk/src/rules/tsdocValidation.ts - About 1 hr to fix

                  Method get has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static String get(int code, Object[] fmtArgs, Locale locale) {
                          try {
                              String s = getFromBundle(code, locale);
                              if (s == null)
                                  return getNotFound(code, locale);
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/mesg/Messages.java - About 1 hr 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 getPrologHalf has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      /* package */ String getPrologHalf(boolean hideUuidIfNoId) {
                          final StringBuilder sb = new StringBuilder(128).append('<').append(_tagnm);
                  
                  //        Do this at client side for ZK-5270
                  //        if ((!hideUuidIfNoId && !shallHideId()) || getId().length() > 0)
                  Severity: Minor
                  Found in zhtml/src/main/java/org/zkoss/zhtml/impl/AbstractTag.java - About 1 hr 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 run has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public final void run(IN input) {
                          
                          C inputClass = getClass(input);
                          
                          doDebug("");
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/fsm/StateMachine.java - About 1 hr 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 startElement has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public void
                      startElement(String nsURI, String lname, String tname, Attributes attrs)
                      throws SAXException {
                  //        if (log.finerable())
                  //            log.finer(message("start element: nsURI=\"" + nsURI + "\", lname=" + lname + ", tname=" + tname
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/idom/input/SAXHandler.java - About 1 hr 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 encodeText has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static final String encodeText(String value) {
                          StringBuffer sb = null;
                          for (int j = 0, len = value.length(); j < len; ++j) {
                              final char cc = value.charAt(j);
                              final String rep;
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/xml/XMLs.java - About 1 hr 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 encodeAttribute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static final String encodeAttribute(String value) {
                          StringBuffer sb = null;
                          for (int j = 0, len = value.length(); j < len; ++j) {
                              final char cc = value.charAt(j);
                              final String rep;
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/xml/XMLs.java - About 1 hr 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 read has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public int read() throws IOException {
                          if (_org != null) {
                              final int b = _org.read();
                              if (!_nobuf && (b >= 0)) {
                                  final OutputStream out = getOutputStream();
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/io/RepeatableInputStream.java - About 1 hr 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 getDefaultTLDs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private static final Map<String, URL> getDefaultTLDs() {
                          Map<String, URL> defURLs = _defURLsRef.get();
                          if (defURLs != null) {
                              return defURLs;
                          }
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/xel/taglib/Taglibs.java - About 1 hr 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 checkAdd has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          private void checkAdd(Item newItem, Item other, boolean replace) {
                              //allowed type?
                              if (!(newItem instanceof Element) && !(newItem instanceof DocType)
                              && !(newItem instanceof Comment)
                              && !(newItem instanceof ProcessingInstruction)
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/idom/Document.java - About 1 hr 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 trim has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static final StringBuffer trim(StringBuffer buf,
                      final int index) {
                          for (int j = index, len = buf.length();; ++j) {
                              if (j >= len) {
                                  buf.delete(index, len);
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/lang/Strings.java - About 1 hr 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 isOctalEscape has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      static boolean isOctalEscape(final char[] text, final int start, final int end) {
                  
                          if (start >= end) {
                              return false;
                          }
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 1 hr 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 isOctalEscape has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      static boolean isOctalEscape(final String text, final int start, final int end) {
                  
                          if (start >= end) {
                              return false;
                          }
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 1 hr 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