Showing 4,841 of 7,782 total issues

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

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

    private final void fixFellows(Collection<Component> c) {
        for (Component comp : c) {
            final String compId = comp.getId();
            if (compId.length() > 0)
                addFellow(comp);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractPage.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 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, Object fmtArg) {
            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 addDeclaredNamespace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static void addDeclaredNamespace(NativeInfo nativeInfo, Collection<Namespace> namespaces,
            LanguageDefinition langdef) {
        for (Namespace ns : namespaces) {
            final String uri = ns.getURI();
            boolean bNatPrefix = uri.startsWith(LanguageDefinition.NATIVE_NAMESPACE_PREFIX);
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 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 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 wrap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static UiException wrap(Throwable t, String msg) {
            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 readObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
        s.defaultReadObject();

        initFields();

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractPage.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 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 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 addToIdSpacesDown has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static void addToIdSpacesDown(Component comp, IdSpace owner) {
        if (!(comp instanceof NonFellow) && !isAutoId(comp.getId()))
            addFellow(comp, owner);

        if (!(comp instanceof IdSpace))
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 removeFromIdSpacesDown has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static void removeFromIdSpacesDown(Component comp, IdSpace owner) {
        if (!(comp instanceof NonFellow) && !isAutoId(comp.getId()))
            removeFellow(comp, owner);

        if (!(comp instanceof IdSpace))
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 getFellowIfAny has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Component getFellowIfAny(String compId, boolean recurse) {
        if (!recurse)
            return getFellowIfAny(compId);

        for (IdSpace idspace = getSpaceOwner(); idspace != null;) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 addShadowRoot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean addShadowRoot(ShadowElement shadow) {
        if (shadow == null) {
            throw new IllegalArgumentException("Shadow element cannot be null!");
        }
        if (shadow.getShadowHost() == null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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