Showing 4,841 of 7,782 total issues

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

    public void service(Event event, Scope scope) throws Exception {
        if (event instanceof StubEvent) {
            EventListenerMap map = ((ComponentCtrl) this).getEventListenerMap();
            if (map != null) {
                map.service(event, scope, this, ((StubEvent) event).getCommand());
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/StubComponent.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 parseComposite has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static Object parseComposite(String expr, Class expcls, int type) {
        if (expr == null)
            return null;

        if (type == LIST) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/xel/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 onChanging$searchBox has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void onChanging$searchBox(InputEvent event) {
        String key = event.getValue();
        LinkedList<DemoItem> item = new LinkedList<DemoItem>();
        DemoItem[] items = getItems();
Severity: Minor
Found in zksandbox/src/main/java/org/zkoss/zksandbox/MainLayoutComposer.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 isSubscribed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean isSubscribed(EventListener<T> listener) {
        if (listener != null)
            for (ListenerInfo<T> li : _listenerInfos)
                if (listener.equals(li.listener))
                    return true;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/impl/DesktopEventQueue.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 addDataHandler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void addDataHandler(DataHandlerInfo info) {
        final String name = info.getName();
        DataHandlerInfo old = _dataHandlers.put(name, info);
        if (info.isOverride()) {
            if (old == null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.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 invokeExecutionCleanups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void invokeExecutionCleanups(Execution exec, Execution parent, List<Throwable> errs) {
        final Class<?>[] ary = _execCleans.toArray();
        for (int j = 0; j < ary.length; ++j) {
            try {
                ((ExecutionCleanup) ary[j].newInstance()).cleanup(exec, parent, errs);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.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 parseLangConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static void parseLangConfig(Locator locator, Element conf) {
        for (Iterator it = conf.getElements("addon-uri").iterator(); it.hasNext();) {
            final Element el = (Element) it.next();
            final String path = el.getText(true);

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

    private static void str(StringBuilder sb, boolean[][] arr) {
        if (arr.length > 1)
            sb.append('[');
        for (int i = 0; i < arr.length; i++) {
            if (i > 0)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentMatchCtx.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 processDynamicWpdWithSourceMapIfAny has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private byte[] processDynamicWpdWithSourceMapIfAny(HttpServletRequest request, HttpServletResponse response, String pkgWpd, String path) throws Exception {
        List<String> dividedPaths = splitSourceMapJsPathIfAny(path);
        StringBuilder sb = new StringBuilder();
        int index = 0;
        String lastWpd = null;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.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 guessImplicitObjectName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static String guessImplicitObjectName(Class<?> cls) {
        if (Execution.class.equals(cls))
            return "execution";
        if (Page.class.equals(cls))
            return "page";
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/Selectors.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 isDescendant has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean isDescendant(Component c1, Component c2) {
        if (c1 == c2)
            return true; // first c1 can be IdSpace
        while ((c1 = c1.getParent()) != null) {
            if (c1 == c2)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.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 getTimeZone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static TimeZone getTimeZone(HttpSession hsess) {
        TimeZone tz = checkTimeZone(hsess.getAttribute(Attributes.PREFERRED_TIME_ZONE));
        if (tz != null)
            return tz;

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

    private static boolean lookingForShadow(List<Selector> list) {
        for (Selector s : list) {
            for (SimpleSelectorSequence seq : s) {
                if (!seq.getPseudoElements().isEmpty()) {
                    return true;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.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 matchValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean matchValue(Object value, Attribute attr) {
        switch (attr.getOperator()) {
        case BEGIN_WITH:
            return value != null && value.toString().startsWith(attr.getValue());
        case END_WITH:

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

    public static final void addActivationListener(ServletContext ctx, WebManagerActivationListener listener) {
        if (ctx == null || listener == null)
            throw new IllegalArgumentException("null");

        final WebManager webman = getWebManagerIfAny(ctx);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/WebManager.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 match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static boolean match(Component component, String selector, Map<String, PseudoClassDef> defs) {
        List<Selector> selectorList = new Parser().parse(selector);
        ComponentMatchCtx ctx = new ComponentMatchCtx(component, selectorList);
        for (Selector s : selectorList) {
            if (s.size() > 1)

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

    private ComponentMatchCtx buildNextCtx() {
        if (_allIds)
            return null;

        // TODO: how to skip tree branches
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.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 getLandingState has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

            protected State getLandingState(Character input, CharClass inputClass) {

                if (input == '[')
                    return State.IN_ATTRIBUTE;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/Tokenizer.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 getCWRURLPrefix has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private String getCWRURLPrefix() {
        final String verInfoEnabled = Library.getProperty("org.zkoss.zk.ui.versionInfo.enabled", "true");
        String build = _wapp.getBuild();
        if (!"true".equals(verInfoEnabled)) {
            return org.zkoss.zk.ui.http.Utils.obfuscateHashWithSalt(build, verInfoEnabled);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/WebManager.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 initializeRenderPatch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        private static PageRenderPatch initializeRenderPatch() {
            final String clsnm = Library.getProperty(org.zkoss.zk.ui.sys.Attributes.PORTLET_RENDER_PATCH_CLASS);
            if (clsnm == null) {
                return new PageRenderPatch() {
                    public Writer beforeRender(RequestInfo reqInfo) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutPortlet.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