Showing 4,829 of 7,767 total issues

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

    public boolean add(E o) {
        if (!_set.contains(o)) {
            boolean ret = _set.add(o);
            //After add, the position can change if not LinkedHashSet
            //bug #1819318 Problem while using SortedSet with Databinding
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelSet.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 fixRowIndices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void fixRowIndices(int j, int to) {
        int realj = getRealIndex(j);
        if (realj < 0)
            realj = 0;
        List items = getChildren();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rows.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 clone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public Object clone() {
        final DefaultTreeNode clone;
        try {
            clone = (DefaultTreeNode) super.clone();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/DefaultTreeNode.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 (!_selection.equals(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/AbstractGroupsModel.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/Longbox.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 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 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 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 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 onEvent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

                public void onEvent(Event event) {
                    if (Strings.isBlank(getWidth()))
                        throw new UiException("captcha must specify width");

                    if (Strings.isBlank(getHeight()))
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Captcha.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 setProgressing has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void setProgressing(boolean progressing) {
        if (_progressing != progressing) {
            if (progressing && "instant".equals(_mode))
                throw new UnsupportedOperationException("progressing not allowed in instant mode");

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

        @SuppressWarnings("unchecked")
        private void render(Radio 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/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 bypassURI has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void bypassURI(List<Object> uris, String suffix) {
        for (ListIterator<Object> it = uris.listIterator(); it.hasNext();) {
            Object o = it.next();
            if (o instanceof String) {
                final String uri = (String) o;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/theme/StandardThemeProvider.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 checkValidConstraint has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void checkValidConstraint(String constraint) {
        int constraintFormatLength = "yyyyMMdd".length(); // default constraint format is yyyyMMdd
        String[] constraintParts = constraint.split(",");
        Pattern numberStartWithKeyword = Pattern.compile("((?<=before |after |between |and )(\\d+))");
        for (String part: constraintParts) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/SimpleDateConstraint.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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

            public Row get(int index) {
                final Rows rows = (Rows) getParent();
                if (rows != null) {
                    int i = 0;
                    for (Iterator<Component> it = rows.getChildren().listIterator(getIndex() + 1); it.hasNext()
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 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 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 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 renderProperties has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
        super.renderProperties(renderer);
        if (isSizedByContent())
            renderer.render("sizedByContent", true);
        if (_span != null)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/MeshElement.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