Showing 7,775 of 7,775 total issues

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

    public void setTimeZone(TimeZone tzone) {
        if (_tzone != tzone) {
            if (_dtzones != null) {
                tzone = _dtzones.contains(tzone) ? tzone : _dtzones.get(0);
            }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Datebox.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 setDisplayedTimeZones has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void setDisplayedTimeZones(String dtzones) {
        if (dtzones == null || dtzones.length() == 0) {
            setDisplayedTimeZones((List<TimeZone>) null);
            return;
        }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Datebox.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 remove has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public V remove(Object key) {
        if (_map.containsKey(key)) {
            //bug #1819318 Problem while using SortedSet with Databinding
            V ret = null;
            removeSelectionByKey(key);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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 getExtendlet has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Extendlet getExtendlet(String ext, boolean lookup) {
        if (ext == null)
            return null;

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

    public void addFilter(String ext, Filter filter, int flags) {
        if (ext == null || filter == null)
            throw new IllegalArgumentException("null");

        filter.init(new FilterConfig() {
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/util/resource/ClassWebResource.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 load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public V load(ResourceInfo src) throws Exception {
        if (src.url != null)
            return parse(src.path, src.url, src.extra);

        // Bug ZK-1132
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/util/resource/ResourceLoader.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 remove has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        public boolean remove(Object o) {
            boolean ret = false;
            if (_set.contains(o)) {
                //bug #1819318 Problem while using SortedSet with Databinding
                removeFromSelection(o);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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 getResource has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public URL getResource(String name) {
        String relativePath = null;
        try {
            URL url = getResource0(relativePath = fixName(name, true));
            return url == null && _prefix != null ? getResource0(relativePath = fixName(name, false)) : url;

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

    /*package*/ void addVisibleItemCount(int count) {
        if (count == 0)
            return;
        Component parent = getParent();
        if (parent instanceof Treeitem) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treechildren.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 setParent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void setParent(Component parent) {
        final Component oldp = getParent();
        if (oldp == parent)
            return; //nothing changed

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

        private PortletRequestDispatcher getRequestDispatcher(Map params, int mode) {
            if (_extctx == null && _svlctx == null && _prtctx == null) //not found
                return null;

            final String uri = generateURI(_uri, params, mode);
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/portlet/Portlets.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 rmFilter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean rmFilter(Map<String, FastReadArray<Filter>> filters, String ext, Filter filter) {
        FastReadArray<Filter> ary = filters.get(ext);
        if (ary != null && ary.remove(filter)) {
            if (ary.isEmpty())
                ary = filters.remove(ext);
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/util/resource/ClassWebResource.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 clone has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Object clone() {
        final Chart clone = (Chart) super.clone();

        // Due to the not unique ID of the area component creating in JFreeChartEngine, we have to clear
        // all its children first.
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Chart.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 loadProperties has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean loadProperties(ServletRequest req, Map<String, Object> pmap) {
        Map<String, Object> map = getPropertyMap(req, "_theme");
        XelContext ctx = buildXelContext(map);
        for (Map.Entry<String, Object> e : pmap.entrySet()) {
            Object objv = e.getValue();
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/fn/ThemeProperties.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 renderWith has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

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

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

    private static void trim(Node node) {
        for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
            final Object o = it.next();
            if (o instanceof TextNode) {
                final String s = ((TextNode) o).getText();
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/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 nextSeparator has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static int nextSeparator(Context ctx, int from, int to) {
        for (; from < to; ++from) {
            final char cc = ctx.content.charAt(from);
            if ((cc < '0' || cc > '9') && (cc < 'a' || cc > 'z') && (cc < 'A' || cc > 'Z') && cc != '_')
                break;
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/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 loadTaglib has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        private void loadTaglib(String prefix, String uri) throws DspException, IOException {
            if (_locator == null)
                throw new DspException("Unable to load " + uri + " because locator is not specified");

            URL url = uri.indexOf("://") > 0 ? null : _locator.getResource(uri);
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/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

Severity
Category
Status
Source
Language