Showing 4,841 of 7,782 total issues

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

    protected void removeBeanMap(TrackerNode node) {
        final Object value = node.getBean();
        if (value != null) {
            node.setBean(null);
            final Set<TrackerNode> nodes = _beanMap.get(value);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.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 doSort has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean doSort(Grid grid) {
        Columns cols = grid.getColumns();
        if (!grid.isAutosort() || cols == null)
            return false;
        for (Iterator it = cols.getChildren().iterator(); it.hasNext();) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.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 setScale has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void setScale(int scale) {
        //bug #3089502: setScale in decimalbox not working
        if (_scale != scale) {
            _scale = scale;
            smartUpdate("scale", scale);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Decimalbox.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 renderAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void renderAll() {
        if (_model == null)
            return;

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

    public void renderItems(Set<? extends Row> rows) {
        if (_model == null) { //just in case that application developers might change it
            if (log.isDebugEnabled())
                log.debug("No model no render");
            return;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.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 getNodesLoadBindings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void getNodesLoadBindings(Set<TrackerNode> basenodes, LinkedHashSet<LoadBinding> bindings,
            LinkedHashSet<Object> kidbases, Set<TrackerNode> visited) {
        if (basenodes != null) {
            for (TrackerNode node : basenodes) {
                if (node != null) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.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 getDataLoader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ DataLoader getDataLoader() {
        if (_dataLoader == null) {
            _rod = evalRod();
            final String loadercls = Library.getProperty("org.zkoss.zul.grid.DataLoader.class");
            try {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.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 sort has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean sort(boolean ascending) {
        final String dir = getSortDirection();
        if (ascending) {
            if ("ascending".equals(dir))
                return false;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Column.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 selectAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void selectAll() {
        if (!_multiple)
            throw new UiException("Appliable only to the multiple seltype: " + this);

        //we don't invoke getItemCount first because it is slow!
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.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 sort has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean sort(boolean ascending) {
        final String dir = getSortDirection();
        if (ascending) {
            if ("ascending".equals(dir))
                return false;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listheader.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 syncValueToSelection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void syncValueToSelection() {
        final String value = getValue();
        if (!Objects.equals(_lastCkVal, value)) {
            _lastCkVal = value;
            _selItem = null;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.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 readObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
        s.defaultReadObject();

        schedSyncValueToSelection();
        if (_model != null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.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 doSort has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean doSort(Tree tree) {
        Treecols cols = tree.getTreecols();
        if (!tree.isAutosort() || cols == null)
            return false;
        for (Component c : cols.getChildren()) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.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 getSubModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public ListModel<E> getSubModel(Object value, int nRows) {
        final List<E> data = new LinkedList<E>();
        nRows = getMaxNumberInSubModel(nRows);
        for (int i = 0; i < _data.length; i++) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/SimpleListModel.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 readObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
        s.defaultReadObject();

        boolean b = s.readBoolean();
        if (b) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listheader.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 getLevel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public int getLevel() {
        int level = 0;
        for (Component item = this;; ++level) {
            final Component tch = item.getParent();
            if (tch == null)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treeitem.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 getActivePage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public int getActivePage() {
        if (hasAttribute(ATTR_ON_INIT_RENDER_POSTED) && _model instanceof Pageable) {
            if (((Pageable) _model).getActivePage() >= 0) { //min page index is 0
                return ((Pageable) _model).getActivePage();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.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 (_caption == child)
            _caption = null;
        else if (_tbar == child)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Panel.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

        public void render(final Comboitem item, final Object data, final int index) {
            final Combobox cb = (Combobox) item.getParent();
            final Template tm = cb.getTemplate("model");
            if (tm == null) {
                item.setLabel(Objects.toString(data));
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.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

Severity
Category
Status
Source
Language