Showing 4,841 of 7,782 total issues

Method renderProperties has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
        super.renderProperties(renderer);

        render(renderer, "autodrop", _autodrop);
        if (!_autocomplete)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.java - About 55 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 init has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private void init() {
        _selItems = new LinkedHashSet<Treeitem>(4);
        _heads = new AbstractCollection<Component>() {
            public int size() {
                int sz = getChildren().size();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 55 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 renderItem0 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private void renderItem0(Renderer renderer, Treeitem item, Object node) throws Throwable {
        if (item.isLoaded()) //all direct children are loaded
            return;

        /*
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

        public void render(Treeitem ti, final Object node, final int index) {
            Tree tree = ti.getTree();
            final Template tm = tree.getTemplate("model");
            if (tm == null) {
                Treecell tc = new Treecell(Objects.toString(node));
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

        @SuppressWarnings("unchecked")
        private void render(Comboitem item, Object value, int index) throws Throwable {
            if (!_rendered && (_renderer instanceof RendererCtrl)) {
                ((RendererCtrl) _renderer).doTry();
                _ctrled = true;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.java - About 55 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 setVisible has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean setVisible(boolean visible) {
        if (isVisible() != visible) {
            smartUpdate("visible", visible);
            int count = isOpen() && _treechildren != null ? _treechildren.getVisibleItemCount() + 1 : 1;
            if (visible) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treeitem.java - About 55 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 onInitRender has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("rawtypes")
    public void onInitRender(Event data) {
        //Bug #2010389
        removeAttribute(ATTR_ON_INIT_RENDER); //clear syncModel flag
        final Renderer renderer = new Renderer();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.java - About 55 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 service has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
        final String cmd = request.getCommand();
        if (cmd.equals(Events.ON_SELECT)) {
            final Tabbox tabbox = getTabbox();
            final Set<Tab> prevSeldItems = new LinkedHashSet<Tab>();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tab.java - About 55 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 getItemAtIndex has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public Radio getItemAtIndex(int index) {
        if (index < 0)
            throw new IndexOutOfBoundsException("Wrong index: " + index);

        final MutableInteger cur = new MutableInteger(0);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 55 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 iterator has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public Iterator<E> iterator() {
        return new Iterator<E>() {
            private Iterator<E> _it = _set.iterator();
            private E _current = null;
            private int _nextIndex;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelSet.java - About 55 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 beforeParentChanged has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public void beforeParentChanged(Component parent) {
        super.beforeParentChanged(parent);
        String cssFlexAutoDisabledCountAttr = MeshElement.CSS_FLEX_AUTO_DISABLED_COUNT;
        //handle new parent
        if (parent != null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Auxhead.java - About 55 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 setValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public void setValue(Comparable<?> series, Comparable<?> category, Number value) {
        List<Comparable<?>> key = new ArrayList<Comparable<?>>(2);
        key.add(series);
        key.add(category);

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

    protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
        super.renderProperties(renderer);
        if ("nodom".equals(this.getMold())) {
            for (Component child = getFirstChild(); child != null; child = child.getNextSibling()) {
                if (child instanceof HtmlBasedComponent && (((HtmlBasedComponent) child).getHflex() != null || ((HtmlBasedComponent) child).getVflex() != null))
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Idspace.java - About 55 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 getComponentById has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static Component getComponentById(Component comp, String id) {
        final int len = id.length();
        if (id.startsWith("uuid(") && id.charAt(len - 1) == ')') {
            Desktop dt = comp.getDesktop();
            if (dt == null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/Utils.java - About 55 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 getVisibleRow has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        private Listitem getVisibleRow(Listitem item) {
            if (item instanceof Listgroup) {
                final Listgroup g = (Listgroup) item;
                if (!g.isOpen()) {
                    for (int j = 0, len = g.getItemCount(); j < len && _it.hasNext(); j++)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 55 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 setFormat has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public void setFormat(String format) throws WrongValueException {
        if (format == null) {
            format = "";
        } else if (format.length() != 0) {
            boolean bCustom;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Datebox.java - About 55 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 smartUpdate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    protected void smartUpdate(String name, Object value) {
        Component comp = getParent();
        if (comp instanceof Treeitem) {
            Treerow tr = ((Treeitem) comp).getTreerow();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treechildren.java - About 55 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 parseCSS has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static int[] parseCSS(String code, int[] arr) {
        if (code == null)
            return arr;
        if (arr == null)
            arr = new int[4];
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/fn/Colors.java - About 55 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 getAttributeNames has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public Enumeration getAttributeNames() {
        final Enumeration _e = _req.getAttributeNames();
        final Iterator _it = _attrs.keySet().iterator();
        return new Enumeration() {
            Object _next;
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/portlet/ResourceHttpServletRequest.java - About 55 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 getFilters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public Filter[] getFilters(String ext, int flag) {
        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 55 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