Showing 7,775 of 7,775 total issues

Method remove has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        public Object remove(Object value) {
            _beanSet.remove(value);
            if (_beanSet.isEmpty()) {
                _beanSet = null;
            } else if (System.identityHashCode(_proxy.get()) == System.identityHashCode(value)) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
Open

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

        if (_max <= 0)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rating.java - About 1 hr 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 setSelectedItem has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void setSelectedItem(Comboitem item) {
        if (item != null && item.getParent() != this)
            throw new UiException("Not a child: " + item);

        if (item != _selItem) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.java - About 1 hr 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 afterUnmarshal has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private void afterUnmarshal(int cnt) {
        for (Iterator it = getChildren().iterator(); it.hasNext();) {
            final Object child = it.next();
            if (child instanceof Treerow) {
                _treerow = (Treerow) child;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treeitem.java - About 1 hr 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 setOpen has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void setOpen(boolean open) {
        if (_open != open) {
            _open = open;
            //Note: _treerow might not be ready yet because it might be
            //initialized before creating child components (for ZK pages)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treeitem.java - About 1 hr 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 onEvent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        public void onEvent(Event event) {
            //Bug ZK-1622: reset anchor position after changing page
            _anchorTop = 0;
            _anchorLeft = 0;
            if (event instanceof PagingEvent) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 1 hr 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 beforeChildAdded has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void beforeChildAdded(Component child, Component refChild) {
        if (child instanceof Treerow) {
            if (_treerow != null && _treerow != child)
                throw new UiException("Only one treerow is allowed: " + this);
        } else if (child instanceof Treechildren) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treeitem.java - About 1 hr 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 insertBefore has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean insertBefore(Component child, Component refChild) {
        if (child instanceof Treerow) {
            if (super.insertBefore(child, refChild)) {
                _treerow = (Treerow) child;
                return true;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treeitem.java - About 1 hr 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 setMode has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void setMode(String mode) throws WrongValueException {
        if (!_mode.equals(mode)) {
            if (!"auto".equals(mode) && !"instant".equals(mode) && !"defer".equals(mode))
                throw new WrongValueException("Unknown mode: " + mode);
            if ((_localized || _progressing) && "instant".equals(mode))
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Include.java - About 1 hr 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 addAll has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean addAll(Collection<? extends E> c) {
        if (_set instanceof LinkedHashSet) {
            int begin = _set.size();
            int added = 0;
            for (final Iterator<? extends E> it = c.iterator(); it.hasNext();) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelSet.java - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
Open

    private void init() {
        _items = new AbstractList<Row>() {
            public int size() {
                return getItemCount();
            }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Group.java - About 1 hr 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 listIterator has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public ListIterator<E> listIterator(final int index) {
        return new ListIterator<E>() {
            private ListIterator<E> _it = _list.listIterator(index);
            private E _current = null;

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

    public void setLabel(String label) {
        final String old = getLabel();
        if (!Objects.equals(old, label)) {
            final Combobox cb = (Combobox) getParent();
            final boolean syncValueToSelection = cb != null && cb.getSelectedItemDirectly() == this;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Comboitem.java - About 1 hr 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 autoFirstCell has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private Label autoFirstCell() {
        Component cell = getFirstChild();
        if (cell == null || cell instanceof Label || cell instanceof Cell) {
            if (cell == null)
                cell = new Label();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Group.java - About 1 hr 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 beforeChildAdded has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void beforeChildAdded(Component child, Component refChild) {
        if (!(child instanceof Row))
            throw new UiException("Unsupported child for rows: " + child);
        if (child instanceof Groupfoot) {
            if (!hasGroup())
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 1 hr 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 setModel has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void setModel(ListModel<?> model) {
        if (disableFeature())
            throw new IllegalAccessError("ZK EE version only!");
        if (model != null) {
            if (!(model instanceof Selectable))
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 1 hr 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 doSort has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    /*package*/ boolean doSort(boolean ascending) {
        final Comparator cmpr = ascending ? _sortAsc : _sortDsc;
        if (cmpr == null)
            return false;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treecol.java - About 1 hr 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 beforeChildAdded has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void beforeChildAdded(Component child, Component refChild) {
        if (child instanceof Caption) {
            if (_caption != null && _caption != child)
                throw new UiException("Only one caption is allowed: " + this);
        } else {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/LayoutRegion.java - About 1 hr 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 getVisibleItemCount has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public int getVisibleItemCount() {
        int count = getItemCount();
        int visibleCount = 0;
        if (getNextSibling() instanceof Listitem) {
            Listitem item = (Listitem) getNextSibling();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listgroup.java - About 1 hr 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 setActivePage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void setActivePage(int pg) throws WrongValueException {
        if (pg < 0) {
            throw new WrongValueException("expecting positive non zero value, got: " + pg);
        }
        if (pg > 0) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java - About 1 hr 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