Showing 7,765 of 7,765 total issues

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

    public Treecol getTreecol() {
        final Tree tree = getTree();
        if (tree != null) {
            final Treecols cs = tree.getTreecols();
            if (cs != null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treefooter.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 onChildRemoved has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void onChildRemoved(Component child) {
        super.onChildRemoved(child);
        if (_north == child)
            _north = null;
        else if (_south == child)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Borderlayout.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 clearSelection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void clearSelection() {
        if (!_selection.isEmpty()) {
            final int[][] paths = getSelectionPaths();
            if (paths != null) {
                _selection.clear();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 coerceFromString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected Object coerceFromString(String value) throws WrongValueException {
        final Object[] vals = toNumberOnly(value);
        final String val = (String) vals[0];
        if (val == null || val.length() == 0)
            return null;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Intbox.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 setDraggable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void setDraggable(String draggable) {
        if (_mode != EMBEDDED) {
            if (draggable != null && (draggable.length() > 0 && !"false".equals(draggable)))
                throw new UiException("Only embedded window could be draggable: " + this);
        }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Window.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 selectNextTab has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private Tab selectNextTab() {
        for (Tab tab = (Tab) getNextSibling(); tab != null; tab = (Tab) tab.getNextSibling())
            if (!tab.isDisabled()) {
                tab.setSelected(true);
                return tab;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tab.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 insertBefore has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean insertBefore(Component child, Component refChild) {
        if (child instanceof Caption) {
            refChild = getFirstChild();
            //always makes caption as the first child
            if (super.insertBefore(child, refChild)) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tab.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 setSelection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void setSelection(Collection<? extends E> selection) {
        if (isSelectionChanged(selection)) {
            if (!_multiple && selection.size() > 1)
                throw new IllegalArgumentException("Only one selection is allowed, not " + selection);
            _selection.clear();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractListModel.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 clearOpen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void clearOpen() {
        if (!_opens.isEmpty()) {
            final int[][] paths = getOpenPaths();
            if (paths != null) {
                _opens.clear();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 getItemCount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public int getItemCount() {
        final Rows rows = (Rows) getParent();
        if (rows != null) {
            int[] g = rows.getGroupsInfoAt(getIndex(), true);
            if (g != null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Group.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 getListheader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Listheader getListheader() {
        final Listbox listbox = getListbox();
        if (listbox != null) {
            final Listhead lcs = listbox.getListhead();
            if (lcs != null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listfooter.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 getItems has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public List<Radio> getItems() {
        //FUTURE: the algorithm is stupid and it shall be similar to Listbox
        //however, it is OK since there won't be many radio buttons in a group
        final List<Radio> items = new ArrayList<Radio>();
        getItems0(this, items);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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 removeValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void removeValue(Comparable<?> series, Comparable<?> category) {
        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 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 getItemCount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public int getItemCount() {
        final Listbox lb = getListbox();
        if (lb != null) {
            int[] g = lb.getGroupsInfoAt(getIndex(), true);
            if (g != null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listgroup.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 getChild has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public E getChild(int[] path) {
        E node = getRoot();
        for (int childCount = 0, i = 0; i < path.length && node != null; i++) {
            if (path[i] < 0 || path[i] > (childCount = getChildCountOptimized(node)))
                return null;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 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 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 setOpenGroup0 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean setOpenGroup0(int groupIndex, boolean open) {
        if (_opens == null) {
            if (open)
                return true; // _opens == null means all open
            int length = getGroupCount();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/SimpleGroupsModel.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 fixItemIndices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void fixItemIndices(int j, int to) {
        int realj = getRealIndex(j);
        if (realj < 0)
            realj = 0;
        if (realj < _items.size()) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.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