Showing 4,841 of 7,782 total issues

Method isListenerAvailable has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean isListenerAvailable(String evtnm, boolean asap) {
        if (_auxinf != null && _auxinf.listeners != null) {
            final List<EventListenerInfo> lis = _auxinf.listeners.get(evtnm);
            if (lis != null) {
                if (!asap)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 clone has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public Object clone() {
        // remove first.
        Collection<Callback> callbacks = new ArrayList<>(getCallback(AFTER_CLONED));
        for (Callback callback : new ArrayList<Callback>(callbacks)) {
            removeCallback(AFTER_CLONED, callback);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 sessionWillPassivate has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public void sessionWillPassivate(Page page) {
        Set<Object> uniqueAttrs = new LinkedHashSet<Object>(); //ZK-2701: use set to record unique attrs and listeners
        if (_auxinf != null && _auxinf.attrs != null) {
            uniqueAttrs.addAll(_auxinf.attrs.getAttributes().values());
            willPassivate(uniqueAttrs); //ZK-2701: only passivate the same object once
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 getMethodProp has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private static String getMethodProp(Method mtd) {
        if (Modifier.isPublic(mtd.getModifiers())) {
            final String nm = mtd.getName();
            final int len = nm.length();
            switch (mtd.getParameterTypes().length) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/Impls.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 doCatch has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ boolean doCatch(Throwable ex, boolean bRoot) {
        if (_composerExts != null)
            for (Composer composer : _composerExts) {
                final boolean old = beforeInvoke(composer, bRoot);
                try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/CreateInfo.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 destroy has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public void destroy() {
        try {
            _config.invokeWebAppCleanups();
        } catch (Throwable ex) {
            log.warn("Failed to invoke webapp cleanups", ex);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.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 addRequest has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private void addRequest(AuRequest request) {
        //case 1, BUSY_IGNORE: Drop any existent ignorable requests
        //We don't need to iterate all because requests is added one-by-one
        //In other words, if any temporary request, it must be the last
        {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/RequestQueueImpl.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 addEventListener has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean addEventListener(String evtnm, EventListener<? extends Event> listener) {
        if (evtnm == null || listener == null)
            throw new IllegalArgumentException("null");
        if (!Events.isValid(evtnm))
            throw new IllegalArgumentException("Invalid event name: " + evtnm);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.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 execCreateChild has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private static Component[] execCreateChild(CreateInfo ci, Component parent, ComponentInfo childInfo,
            ReplaceableText replaceableText, Component insertBefore) {
        final ComponentDefinition childdef = childInfo.getComponentDefinition();
        if (childdef.isInlineMacro()) {
            if (insertBefore != null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 isCaseMatched has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean isCaseMatched(ZkInfo caseInfo, Page page, Component parent, Object switchCond) {
        if (!caseInfo.withCase())
            return true; //default clause

        final Object[] caseValues = caseInfo.resolveCase(page, parent);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 toNodeString has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static String toNodeString(Node next, StringBuffer path) {
        if (next instanceof AstBracketSuffix) {
            final String bracketString = toNodeString(next.jjtGetChild(0), new StringBuffer()); //recursive
            path.append("[").append(bracketString).append("]");
        } else if (next instanceof AstValue) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELContext.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 toNodeString has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static String toNodeString(Node next, StringBuilder path) {
        if (next instanceof AstBracketSuffix) {
            final String bracketString = toNodeString(next.jjtGetChild(0), new StringBuilder()); //recursive
            path.append("[").append(bracketString).append("]");
        } else if (next instanceof AstValue) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELContext.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 initValidationMessages has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private ValidationMessages initValidationMessages(BindEvaluatorX evalx, Component comp, Binder binder) {
        final ComponentCtrl compCtrl = (ComponentCtrl) comp;
        final Annotation idanno = compCtrl.getAnnotation(VALIDATION_MESSAGES_ATTR, ID_ANNO);
        final Annotation initanno = compCtrl.getAnnotation(VALIDATION_MESSAGES_ATTR, INIT_ANNO);
        Object vmessages = null;
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/BindComposer.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 resolvePositionalOrNoAnnoParameter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private Object resolvePositionalOrNoAnnoParameter(Class<?> returnType, Method method, int index) {
        Object val = null;
        if (_bindingArgs != null) {
            int argIndex = 0;
            for (Map.Entry<String, Object> entry : _bindingArgs.entrySet()) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/ParamCall.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 remove has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public V remove(Object key) {
        if (key == null) {
            key = KeyFactory.NULL;
        }

Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.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 remove has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

                public boolean remove(Object o) {
                    if (!(o instanceof Map.Entry)) {
                        return false;
                    }
                    Map.Entry entry = (Map.Entry) o;
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.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 resolveTemplate has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public Template resolveTemplate(Component eachComp, final Object eachData, final int index, final int size,
            final String subType) {
        final Object value = evaluateTemplate(eachComp, eachData, index, size, subType);
        if (value instanceof Template) {
            return (Template) value;
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/TemplateResolverImpl.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 setMold has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public void setMold(String mold) {
        final String old = getMold();
        if (!Objects.equals(old, mold)) {
            super.setMold(mold);
            //we have to change model before detaching paging,
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.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 addToolbar has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean addToolbar(String name, Toolbar toolbar) {
        Component refChild = null;
        if ("tbar".equals(name)) {
            if (_tbar != null)
                throw new UiException("Only one top toolbar child is allowed: " + this);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Panel.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 removePartial has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean removePartial(Collection<?> c, boolean exclude) {
        boolean removed = false;
        int index = 0;
        int begin = -1;
        // B60-ZK-1126.zul
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelList.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