Showing 7,765 of 7,765 total issues

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

    public Component newInstance(Class<? extends Component> cls) {
        final Object curInfo = ComponentsCtrl.getCurrentInfo();
        boolean bSet = true;
        if (curInfo instanceof ComponentInfo) {
            bSet = ((ComponentInfo) curInfo).getComponentDefinition() != this;

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

    protected String getStartScript() {
        final String start = _desktop.getWebApp().getConfiguration().getPreference("PollingServerPush.start", null);
        if (start != null)
            return start;

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

    public void sessionDidActivate(Desktop desktop) {
        _desktop = desktop;

        if (_ownerUuid != null) {
            setOwner(_desktop.getComponentByUuid(_ownerUuid));
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.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 hasSuspendedThread has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean hasSuspendedThread() {
        if (!_suspended.isEmpty()) {
            synchronized (_suspended) {
                for (Map map : _suspended.values())
                    if (!map.isEmpty())
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 setCSSCacheControl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static boolean setCSSCacheControl(ServletContext context, HttpServletRequest request,
            HttpServletResponse response) {
        int hours = 8760;
        final String PROP = "org.zkoss.web.classWebResource.cache.CSS.hours";
        String s = Library.getProperty(PROP);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/fn/JspFns.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 invokeDesktopCleanups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void invokeDesktopCleanups() {
        if (_dtCleans != null) {
            for (Iterator<DesktopCleanup> it = new LinkedList<DesktopCleanup>(_dtCleans).iterator(); it.hasNext();) {
                final DesktopCleanup listener = it.next();
                try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.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 disableClientUpdate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean disableClientUpdate(Component comp, boolean disable) {
        if (disable) {
            if (_updDisabled == null)
                _updDisabled = new HashSet<Component>(4);
            return !_updDisabled.add(comp);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.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 inEventListener has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ static final void inEventListener(boolean in) {
        if (in) {
            if (_inEvt == null)
                _inEvt = new ThreadLocal<Boolean>();
            _inEvt.set(Boolean.TRUE);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/EventProcessor.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 removeDesktop has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static boolean removeDesktop(Execution exec) {
        final Desktop dt = exec.getDesktop();
        final WebApp wapp = dt.getWebApp();
        final DesktopRecycle dtrc = wapp.getConfiguration().getDesktopRecycle();
        if (dtrc != null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopRecycles.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 getAvailableAtClient has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static Set<? extends Component> getAvailableAtClient(Component comp,
            Map<Component, Set<? extends Component>> croppingInfos) {
        final Object xc = ((ComponentCtrl) comp).getExtraCtrl();
        if (xc instanceof Cropper) {
            //we don't need to check isCropper first since its component's job
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.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 getAttribute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Object getAttribute(String name, boolean recurse) {
        Object val = getAttribute(name);
        return val != null || !recurse || hasAttribute(name) ? val
                : _desktop != null ? _desktop.getAttribute(name, true) : null;
    }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.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

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

    public static XMLResourcesLocator getXMLResourcesLocator() {
        if (_xmlloc == null) {
            final String clsnm = Library.getProperty("org.zkoss.zk.ui.sys.XMLResourcesLocator.class");
            if (clsnm != null) {
                try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/Utils.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 addInvalidate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void addInvalidate(Component comp) {
        final Page page = comp.getPage();
        if (_recovering || _disabled || page == null || page instanceof VolatilePage || !_exec.isAsyncUpdate(page)
                || isCUDisabled(comp))
            return; //nothing to do
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.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 addSmartUpdate0 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void addSmartUpdate0(Component comp, String attr, Object value, boolean append, int priority) {
        if (comp == null)
            throw new IllegalArgumentException();
        //main fix for BUG ZK-1464
        if (_ending && (comp.getPage() == null || (_pgRemoved != null && _pgRemoved.contains(comp.getPage())))) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.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 isCUDisabled has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private final boolean isCUDisabled(Component comp) {
        if (_updDisabled != null) {
            //no need to check comp.getPage() since it was checked before calling
            for (; comp != null; comp = comp.getParent())
                if (_updDisabled.contains(comp))
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.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 isAncestor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean isAncestor(Collection<Component> coll, Component comp, boolean includingEquals) {
        for (Iterator<Component> it = coll.iterator(); it.hasNext();) {
            final Component c = it.next();
            if ((includingEquals || c != comp) && Components.isAncestor(c, comp))
                return true;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.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