Showing 7,775 of 7,775 total issues

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

    private static void parseTextAs(ComponentDefinitionImpl compdef, Element el) {
        if (el != null) {
            final String s = el.getText(true);
            noEmpty("text-as", s, el);
            noEL("text-as", s, el);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.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 setDefaultWidgetClass has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void setDefaultWidgetClass(String widgetClass) {
        final ExValue oldwc = _defWgtClass;
        _defWgtClass = new ExValue(widgetClass, String.class);

        //replace mold's widget class if it is the old default one

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() {
            final StringBuffer sb = new StringBuffer().append('@').append(_name).append('(');
            if (_attrs != null) {
                boolean first = true;
                for (Map.Entry<String, String[]> me : _attrs.entrySet()) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AnnotationMap.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 setForEach has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void setForEach(String expr, String begin, String end) {
        _forEach = Utils.parseList(expr, Object.class, false);
        //forEach="" means to iterate a single-element array and the value
        //is empty
        _forEachInfo = _forEach == null ? null
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ForEachBranchInfo.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 isDynamicValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected boolean isDynamicValue(String propName) {
        final ComponentCtrl compCtrl = this;
        Collection<Annotation> annos = compCtrl.getAnnotations(propName);
        if (!annos.isEmpty()) {
            for (Annotation anno : annos) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.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 setParent0 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void setParent0(Component parent) {
        if (_host != null && parent != null) {
            throw new UiException("As a shadow root cannot be a child of a shadow element.");
        }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.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 mergeToHost has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean mergeToHost(Component host) {
        if (host == null)
            throw new UiException("The host cannot be null.");
        if (host == _host)
            return false; // nothing to do
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.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 getCurrent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final Scope getCurrent(Page page) {
        final List<Scope> nss = _scopes.get();
        final Scope scope = nss != null && !nss.isEmpty() ? nss.get(0) : null;
        if (scope != null)
            return scope;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/ext/Scopes.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 getScope has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final int getScope(String scope) {
        if ("component".equals(scope))
            return Component.COMPONENT_SCOPE;
        if ("space".equals(scope))
            return Component.SPACE_SCOPE;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/Components.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 isShadowElement has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static final boolean isShadowElement(LanguageDefinition langdef, PageDefinition pgdef, String nm,
            String pref, String uri, boolean bNativeContent) {
        // feature in 8.0.0, no need to check namespace, if any.
        if ("true".equalsIgnoreCase(Library.getProperty("org.zkoss.zk.namespace.tolerant", "false")))
            return langdef.hasShadowDefinition(nm) || (!"xul/html".equals(langdef.getName())
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.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 setClientAttribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public String setClientAttribute(String name, String value) {
        if (name == null)
            throw new IllegalArgumentException();

        final String old;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 afterComponentPageChanged has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void afterComponentPageChanged(Page newpg, Page oldpg) {
        if (newpg == oldpg) {
            // Orphan case: detached again after the parent was detached
            if (getParent() == null && oldpg == null) {
                WebApps.getCurrent().getConfiguration().afterComponentDetached(this, null);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 getAttribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Object getAttribute(String name, boolean recurse) {
        Object val = getAttribute(name);
        if (val != null || !recurse || hasAttribute(name))
            return val;

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

    public String getDownloadMediaURI(Media media, String pathInfo) {
        if (media == null)
            throw new IllegalArgumentException("null media");

        if (_meds == null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.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 addSharedEventHandlerMap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void addSharedEventHandlerMap(EventHandlerMap evthds) {
        if (evthds != null && !evthds.isEmpty()) {
            unshareEventHandlerMap(false);
            if (initAuxInfo().evthds == null) {
                _auxinf.evthds = evthds;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 setTemplate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Template setTemplate(String name, Template template) {
        if (template == null) {
            return _auxinf != null && _auxinf.templates != null ? _auxinf.templates.remove(name) : null;
        } else {
            AuxInfo auxinf = initAuxInfo();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 getAttribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Object getAttribute(String name, boolean recurse) {
        Object val = getAttribute(name);
        if (val != null || !recurse || hasAttribute(name))
            return val;
        if (_sess != null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.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 init has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static void init(Map<String, Component> fellows, Component comp) {
        if (!(comp instanceof NonFellow)) {
            final String compId = comp.getId();
            if (!AbstractComponent.isAutoId(compId))
                fellows.put(compId, comp);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/VirtualIdSpace.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 findNearestShadow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private HtmlShadowElement findNearestShadow(HtmlShadowElement current, Component baseChild) {
        List<ShadowElement> list = cast(current.getChildren());
        for (ShadowElement sh : list) {
            if (sh instanceof HtmlShadowElement) {
                HtmlShadowElement shadow0 = (HtmlShadowElement) sh;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 afterPageAttached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void afterPageAttached(Page page, Desktop desktop) {
        if (_uiCycles != null) {
            for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                final UiLifeCycle listener = it.next();
                try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.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