Showing 4,841 of 7,782 total issues

Method next has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public T next() {
        if (_nextAvail) {
            _nextAvail = false;
            return _converter.convert(_next);
        }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/ComodifiableIterator.java - About 35 mins 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 toString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public final static String toString(Object[] array) {
        if (array == null)
            return "null";

        StringBuffer sb = new StringBuffer(128).append('[');
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/ArraysX.java - About 35 mins 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 toString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public String toString() {
        tryExpunge();

        final StringBuffer sb = new StringBuffer(128).append('{');
        if (!_map.isEmpty()) {
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/CacheMap.java - About 35 mins 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 resolveVariable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        public Object resolveVariable(String name) {
            if (custom != null) {
                final Object o = custom instanceof VariableResolverX ?
                    ((VariableResolverX)custom).resolveVariable(null, null, name):
                    custom.resolveVariable(name);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/resource/impl/LabelLoaderImpl.java - About 35 mins 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 resolveVariable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static Object resolveVariable(XelContext ctx, Object base, Object name) {
        if (ctx != null) {
            VariableResolver resolver = ctx.getVariableResolver();
            if (resolver instanceof VariableResolverX)
                return  ((VariableResolverX)resolver).resolveVariable(ctx, base, name);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/xel/util/Evaluators.java - About 35 mins 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 expunge has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public int expunge() {
        if (_inExpunge || _map.isEmpty()) return _map.size(); //nothing to do

        _inExpunge = true;
        try {
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/CacheMap.java - About 35 mins 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 nextVerSeparator has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static final int nextVerSeparator(String version, int from) {
        for (final int len = version.length(); from < len; ++from) {
            final char cc = version.charAt(from);
            if ((cc < '0' || cc > '9') && (cc < 'a' || cc > 'z')
            && (cc < 'A' || cc > 'Z'))
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/Utils.java - About 35 mins 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 containsKey has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean containsKey(Object key) {
        boolean found = _cache.containsKey(key);
        if (!found && _moreInWriteCache)
            synchronized (this) {
                if (_writeCache != null && (found = _writeCache.containsKey(key)))
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/FastReadCache.java - About 35 mins 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 getResource has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public URL getResource(String name) {
        // no need to use Classes.getContextClassLoader() here because of the loading order issue
        final ClassLoader cl = Thread.currentThread().getContextClassLoader();
        URL url = cl != null ? cl.getResource(resolveName(name)): null;
        if (url != null) {
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/resource/ClassLocator.java - About 35 mins 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 resolveVariable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static Object resolveVariable(XelContext ctx,
    VariableResolver resolver, Object base, Object name) {
        if (resolver instanceof VariableResolverX) {
            if (ctx == null)
                ctx = new SimpleXelContext(resolver);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/xel/util/Evaluators.java - About 35 mins 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 zzRefill has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  private boolean zzRefill() throws java.io.IOException {

    /* first: make room (if you can) */
    if (zzStartRead > 0) {
      System.arraycopy(zzBuffer, zzStartRead,
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/json/parser/Yylex.java - About 35 mins 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 removeDotDot has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static int removeDotDot(StringBuffer sb, int j) {
        int k = j;
        while (--k >= 0 && sb.charAt(k) != '/') 
            ;

Severity: Minor
Found in zcommon/src/main/java/org/zkoss/io/Files.java - About 35 mins 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 length has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final int length(Object o) {
        if (o instanceof String) {
            return ((String)o).length();
        } else if (o == null) {
            return 0;
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java - About 35 mins 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 isInstance has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static boolean isInstance(Object c, Object o) {
        if (c instanceof Class) {
            return ((Class)c).isInstance(o);
        } else if (c instanceof String) {
            try {
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java - About 35 mins 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 deleteAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final boolean deleteAll(File file) {
        if (file.isDirectory()) {
            final File[] fls = file.listFiles();
            for (int j = 0; j < fls.length; ++j) {
                if (!deleteAll(fls[j]))
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/io/Files.java - About 35 mins 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 getClassOfSignature has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static final
    Class getClassOfSignature(ClassResolver resolver, String clsnm)
    throws ClassNotFoundException {
        try {
            return resolver != null ?
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.java - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Object getValue(ELContext context, Object base, Object property) {

        if (context == null) {
            throw new NullPointerException();
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/ResourceBundleELResolver.java - About 35 mins 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 put has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        public final void put(Element e, Element following) {
            final String name = e.getName();
            List<Element> valueList = _map.computeIfAbsent(name,
                    k -> new LinkedList<>());

Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/impl/AbstractGroup.java - About 35 mins 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 parseIntFromReference has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    static int parseIntFromReference(final String text, final int start, final int end, final int radix) {
        int result = 0;
        for (int i = start; i < end; i++) {
            final char c = text.charAt(i);
            int n = -1;
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 35 mins 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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final Object get(Object obj, String name)
    throws NoSuchMethodException {
        try {
            final AccessibleObject acs = Classes.getAccessibleObject(
                obj.getClass(), name, null,
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/reflect/Fields.java - About 35 mins 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