Showing 4,841 of 7,782 total issues

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

    private void renderWith(ActionContext ac, Status st, short[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Short(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, float[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Float(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 renderWith has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void renderWith(ActionContext ac, Status st, double[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Double(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 getResource has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final URL getResource(ServletContext ctx, String uri) throws UnsupportedEncodingException {
        try {
            if (uri != null && uri.toLowerCase(java.util.Locale.ENGLISH).startsWith("file://")) {
                final File file = new File(new URI(Https.sanitizePath(uri)));
                return file.exists() ? file.toURI().toURL() : null;
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.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 getResourceAsStream has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final InputStream getResourceAsStream(ServletContext ctx, String uri) throws IOException {
        try {
            if (uri != null && uri.toLowerCase(java.util.Locale.ENGLISH).startsWith("file://")) {
                final File file = new File(new URI(uri));
                return file.exists() ? new BufferedInputStream(new FileInputStream(file)) : null;
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.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, int[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Integer(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 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