Showing 4,841 of 7,782 total issues

Method processFormBindings has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void processFormBindings(Component comp) {
        final ComponentCtrl compCtrl = (ComponentCtrl) comp;
        final BindEvaluatorX eval = _binder.getEvaluatorX();
        //validator information
        ExpressionAnnoInfo validatorInfo = parseValidator(comp, FORM_ATTR);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/AnnotateBinderHelper.java - About 1 hr to fix

    Method listIterator has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public ListIterator<E> listIterator(final int index) {
            return new ListIterator<E>() {
                private ListIterator<E> _it = _list.listIterator(index);
                private E _current = null;
    
    
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/ListModelList.java - About 1 hr to fix

      Function on has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function on( elem, types, selector, data, fn, one ) {
          var origFn, type;
      
          // Types can be a map of types/handlers
          if ( typeof types === "object" ) {
      Severity: Minor
      Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

        Function toggleClass has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            toggleClass: function( value, stateVal ) {
                var type = typeof value,
                    isValidValue = type === "string" || Array.isArray( value );
        
                if ( typeof stateVal === "boolean" && isValidValue ) {
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

          Function setOffset has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              setOffset: function( elem, options, i ) {
                  var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
                      position = jQuery.css( elem, "position" ),
                      curElem = jQuery( elem ),
                      props = {};
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

            Function getSetOffset has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function getSetOffset(input, keepLocalTime, keepMinutes) {
                    var offset = this._offset || 0,
                        localAdjust;
                    if (!this.isValid()) {
                        return input != null ? this : NaN;
            Severity: Minor
            Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

              Function toISOString$1 has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function toISOString$1() {
                      // for ISO strings we do not use the normal bubbling rules:
                      //  * milliseconds bubble up until they become hours
                      //  * days do not bubble at all
                      //  * months bubble up until they become years
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

                Method segmentInner has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    @SuppressWarnings("unchecked")
                    private FilterMap segmentInner(Map map) {
                        final Map segFound = new HashMap();
                        for (Iterator it = map.entrySet().iterator(); it.hasNext();) {
                            final Map.Entry me = (Map.Entry)it.next();

                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 getInstance has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static Media getInstance(Media media) {
                        if (media != null && !media.inMemory()
                        && !(media instanceof RepeatableMedia)) {
                            if (media.isBinary()) {
                                final InputStream data = media.getStreamData(),
                Severity: Minor
                Found in zcommon/src/main/java/org/zkoss/util/media/RepeatableMedia.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 copy has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static final void copy(File dst, File src, int flags)
                    throws IOException {
                        if (!src.exists())
                            throw new FileNotFoundException(src.toString());
                
                
                Severity: Minor
                Found in zcommon/src/main/java/org/zkoss/io/Files.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 getCause has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static final Throwable getCause(Throwable ex) {
                        Throwable t = ex.getCause();
                        if (t == null)
                            try {
                                if (ex instanceof java.rmi.RemoteException) {
                Severity: Minor
                Found in zcommon/src/main/java/org/zkoss/lang/Exceptions.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 equals has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                        public boolean equals(Object o) {
                            if (this == o) return true;
                            if (!(o instanceof AOInfo))
                                return false;
                
                
                Severity: Minor
                Found in zcommon/src/main/java/org/zkoss/lang/Classes.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 addImportedClass has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void addImportedClass(String clsptn)
                    throws ClassNotFoundException {
                        if (clsptn == null || (clsptn = clsptn.trim()).length() == 0)
                            throw new IllegalArgumentException("empty");
                
                
                Severity: Minor
                Found in zcommon/src/main/java/org/zkoss/lang/ImportedClassResolver.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 isAssignableFrom has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static boolean isAssignableFrom(Class<?> src, Class<?> target) {
                        // src will always be an object
                        // Short-cut. null is always assignable to an object and in EL null
                        // can always be coerced to a valid value for a primitive
                        if (src == null) {
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.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 isIdentifier has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static boolean isIdentifier(String key) {
                
                        if (SKIP_IDENTIFIER_CHECK) {
                            return true;
                        }
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/util/Validation.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 getValue has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public Object getValue(EvaluationContext ctx)
                            throws ELException {
                        Object obj = this.children[0].getValue(ctx);
                
                        if (obj == null) {
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstNegative.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 populateSetters has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static Method[] populateSetters(Class<?> cls, String propertyName) {
                        String setterName = "";
                        if (propertyName != null && propertyName.length() > 0){
                            setterName = new StringBuilder("set").append(propertyName.substring(0, 1).toUpperCase(Locale.ENGLISH))
                                    .append(propertyName.substring(1)).toString();
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.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 setValue has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void setValue(EvaluationContext ctx, Object value)
                            throws ELException {
                        Target t = getTarget(ctx);
                        ctx.setPropertyResolved(false);
                        ELResolver resolver = ctx.getELResolver();
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstValue.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 FillBuff has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                  protected void FillBuff() throws java.io.IOException
                  {
                    if (maxNextCharInd == available)
                    {
                      if (available == bufsize)
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.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 isAssignableFrom has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    static boolean isAssignableFrom(Class<?> src, Class<?> target) {
                        // src will always be an object
                        // Short-cut. null is always assignable to an object and in EL null
                        // can always be coerced to a valid value for a primitive
                        if (src == null) {
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/Util.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