Showing 7,777 of 7,777 total issues

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

        public boolean hasNext() {
            if (_tree == null || !_tree.inPagingMold())
                return _it.hasNext();

            Integer renderedCount = (Integer) _tree.getAttribute(Attributes.RENDERED_ITEM_COUNT);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treechildren.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 equals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean equals(Object o) {
        if (this == o)
            return true;
        PortletSession val = o instanceof PortletSession ? (PortletSession) o
                : o instanceof PortletHttpSession ? ((PortletHttpSession) o)._sess : null;
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/portlet/PortletHttpSession.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 toHex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private static String toHex(String color) {
        color = color.trim();
        if (color.startsWith("#")) {
            int end = color.indexOf(" ");
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/fn/ThemeFns.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 writeObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        private void writeObject(java.io.ObjectOutputStream s) throws IOException {
            s.defaultWriteObject();
            if (_entry != null) {
                s.writeObject(_entry.getKey());
                s.writeObject(_entry.getValue());
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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 getThreadLocals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void getThreadLocals() {
        try {
            Class cls = Classes
                    .forNameByThread("org.springframework.transaction.support.TransactionSynchronizationManager");

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

    public boolean equals(Object o) {
        if (this == o)
            return true;
        ResourceResponse val = o instanceof ResourceResponse ? (ResourceResponse) o
                : o instanceof ResourceHttpServletResponse ? ((ResourceHttpServletResponse) o)._res : 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 include has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public void include(HttpServletRequest request, HttpServletResponse response, String uri, Map params)
                throws ServletException, IOException {
            //Note: it is caller's job to convert related path to ~./
            if (uri.startsWith("~./") && uri.indexOf('?') < 0 && isDirectInclude(uri)) {
                Object old = request.getAttribute(Attributes.ARG);
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/util/resource/ClassWebResource.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 equals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean equals(Object o) {
        if (this == o)
            return true;
        ResourceRequest val = o instanceof ResourceRequest ? (ResourceRequest) o
                : o instanceof ResourceHttpServletRequest ? ((ResourceHttpServletRequest) o)._req : null;
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/portlet/ResourceHttpServletRequest.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 toIEHex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private static String toIEHex(String color) {
        color = color.trim();
        if (color.startsWith("#")) {
            int end = color.indexOf(" ");
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/fn/ThemeFns.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 equals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean equals(Object o) {
        if (this == o)
            return true;
        RenderRequest val = o instanceof RenderRequest ? (RenderRequest) o
                : o instanceof RenderHttpServletRequest ? ((RenderHttpServletRequest) o)._req : null;
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/portlet/RenderHttpServletRequest.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 getResourceAsStream has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public InputStream getResourceAsStream(String uri) {
        uri = fixURI(uri);
        if (_extraloc != null) {
            final InputStream is = _extraloc.getResourceAsStream(uri);
            if (is != null)
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/util/resource/ClassWebResource.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 equals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean equals(Object o) {
        if (this == o)
            return true;
        RenderResponse val = o instanceof RenderResponse ? (RenderResponse) o
                : o instanceof RenderHttpServletResponse ? ((RenderHttpServletResponse) o)._res : null;
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/portlet/RenderHttpServletResponse.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 removeFilter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean removeFilter(String ext, Filter filter, int flags) {
        if (ext == null || filter == null)
            return false;

        ext = ext.toLowerCase(java.util.Locale.ENGLISH);
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/util/resource/ClassWebResource.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 getResource has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public URL getResource(String uri) {
        uri = fixURI(uri);
        if (_extraloc != null) {
            final URL url = _extraloc.getResource(uri);
            if (url != null)
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/util/resource/ClassWebResource.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 toDate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static final Date toDate(String sdate) throws ParseException {
        ParseException ex = null;
        for (String df : _dfs) {
            try {
                return new SimpleDateFormat(df, Locale.US).parse(sdate);
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.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 startsWith has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean startsWith(String content, int from, int to, String s) {
        for (int j = 0, len = s.length();; ++from, ++j) {
            if (j >= len)
                return true;
            if (from >= to || content.charAt(from) != s.charAt(j))
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void render(ActionContext ac, boolean nested) throws DspException, IOException {
        if (!isEffective())
            return;

        final Action parent = ac.getParent();
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/action/When.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 renderWith has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void renderWith(ActionContext ac, Status st) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j <= _end; ++j) {
            final Object val = new Integer(j);
            if (_var != null)
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.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 include has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static final void include(ServletContext ctx, ServletRequest request, ServletResponse response, String uri,
            Map params, int mode) throws IOException, ServletException {
        //        if (log.isDebugEnabled()) log.debug("Including "+uri+" at "+ctx);

        //Note: we don't optimize the include to call ClassWebResource here
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.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 toScope has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected static final int toScope(String scope) {
        return "request".equals(scope) ? ActionContext.REQUEST_SCOPE
                : "session".equals(scope) ? ActionContext.SESSION_SCOPE
                        : "application".equals(scope) ? ActionContext.APPLICATION_SCOPE : ActionContext.PAGE_SCOPE;
    }
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/action/AbstractAction.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