Showing 7,765 of 7,765 total issues

Method findExact has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static Method findExact(final Method[] mtds, final Object val) {
        if (val != null) {
            final Class vcls = val.getClass();
            for (int j = 0; j < mtds.length; ++j)
                if (vcls.equals(mtds[j].getParameterTypes()[0]))
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.java - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Object getValue(Component comp) {
        if (_value != null)
            return _value.getValue(_evalr, comp);

        Desktop desktop = comp.getDesktop();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.java - About 25 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 init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void init(LanguageDefinition langdef, PageDefinition pgdef, String name, Object cls) {
        if (name == null)
            throw new IllegalArgumentException();
        if (langdef != null && pgdef != null)
            throw new IllegalArgumentException("langdef and pgdef cannot both null or both non-null");

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

    private static String modifyAttrValueIfSimplified0(String nm, String val, int paramIndex, boolean isNamedParam) {
        if (nm == null) {
            if (isNamedParam)
                throwCommandSimplifiedErrorUsage();
            if (paramIndex != -1) //skip command method name
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 25 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 wrap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static UiException wrap(Throwable t) {
            t = Exceptions.unwrap(t);
            boolean skipWrapping = false;
            if (t instanceof Expectable)
                skipWrapping = true;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/UiException.java - About 25 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 replace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static void replace(Component oldc, Component newc) {
        final Component p = oldc.getParent(), sib = oldc.getNextSibling();
        if (p != null) {
            oldc.detach();
            p.insertBefore(newc, sib);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 25 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 encodeToURL has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static final URL encodeToURL(String uri) throws MalformedURLException {
        final Execution exec = getCurrent();
        uri = exec.encodeURL(uri);
        if (uri.indexOf("://") < 0) {
            final StringBuffer sb = new StringBuffer(256).append(exec.getScheme()).append("://")
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/Executions.java - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Object resolveVariable(Component child, String name, boolean recurse) {
        if (_firstInsertion == null) // out of our range;
            return null;

        if (child == null || child.getParent() == null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 25 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 resolveImplementationClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Class<?> resolveImplementationClass(Page page, String clsnm) throws ClassNotFoundException {
        final Object cls = clsnm != null ? clsnm : _implcls;
        if (cls instanceof String) {
            clsnm = (String) cls;
            final Class<?> found = page != null ? page.resolveClass(clsnm) : Classes.forNameByThread(clsnm);

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

    public static void addLanguage(Locator locator, URL url) {
        if (locator == null || url == null)
            throw new IllegalArgumentException("null");

        if (_loaded) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.java - About 25 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 setRootAttribute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void setRootAttribute(String name, String value) {
        if (name == null || name.length() == 0)
            throw new IllegalArgumentException();

        if (_rootAttrs == null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 25 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 beforeParentChanged has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void beforeParentChanged(Component parent) {
        if (parent != null) {
            if (!(parent instanceof ShadowElement))
                throw new UiException("Unsupported parent for shadow element: " + parent);
            if (_host != null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 25 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 wrap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static UiException wrap(Throwable t, int code, Object[] fmtArgs) {
            t = Exceptions.unwrap(t);
            boolean skipWrapping = false;
            if (t instanceof Expectable)
                skipWrapping = true;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/UiException.java - About 25 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 wrap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static UiException wrap(Throwable t, int code) {
            t = Exceptions.unwrap(t);
            boolean skipWrapping = false;
            if (t instanceof Expectable)
                skipWrapping = true;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/UiException.java - About 25 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 removeSclass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void removeSclass(String cssClass) {
        String sclass = getSclass();
        if (sclass != null) {
            String[] input = cssClass.split(" ");
            String cur = " " + sclass + " ";
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 25 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 getAnnotations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Collection<Annotation> getAnnotations(String propName, String annotName) {
        if (_annots != null) {
            final Map<String, List<Annotation>> anmap = _annots.get(propName);
            if (anmap != null) {
                List<Annotation> ans = anmap.get(annotName);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AnnotationMap.java - About 25 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 onHostDetached has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected void onHostDetached(Component host) {
        if (host instanceof ComponentCtrl) {
            if (((ComponentCtrl) host).getShadowRoots().isEmpty()) {
                Iterable<EventListener<? extends Event>> eventListeners = host
                        .getEventListeners(ON_REBUILD_SHADOW_TREE_LATER);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public String toString() {
        final StringBuilder sb = new StringBuilder(40).append("[zscript: ");
        if (_url != null) {
            sb.append(_url);
        } else {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ZScript.java - About 25 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 locateClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private static <T> Class<? extends T> locateClass(String clsnm, Class<?>... clses) throws Exception {
        final Class<?> c = Classes.forNameByThread(clsnm, false); // check only for ZK-5257
        if (clses != null)
            for (Class<?> cls : clses)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.java - About 25 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 resolveMethod0 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static final Method resolveMethod0(Class cls, String mtdnm) throws PropertyNotFoundException {
        try {
            return Classes.getCloseMethod(cls, mtdnm, new Class[] { String.class });
        } catch (NoSuchMethodException ex) {
            try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.java - About 25 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