Showing 7,758 of 7,758 total issues

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

    @SuppressWarnings("unchecked")
    public Tracker getTracker() {
        if (_tracker == null) {
            String clznm = Library.getProperty("org.zkoss.bind.Tracker.class");
            if (clznm != null) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.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 dumpCompMap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void dumpCompMap(boolean dumpNodes) {
        System.out.println("******* _compMap: *********");
        System.out.println("******* size: " + _compMap.size());
        for (Component comp : _compMap.keySet()) {
            System.out.println("comp:" + comp + "------------");
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 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 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/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 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 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 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 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 beforeChildAdded has a Cognitive Complexity of 6 (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 if (refChild instanceof Caption) {
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 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 setActivePage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void setActivePage(int pg) throws WrongValueException {
        if (pg < 0) {
            throw new WrongValueException("active page index should >= 0");
        }
        if (pg >= getPageCount()) {
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 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 doModal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void doModal() {
        if (!isEventThreadEnabled(true)) {
            checkOverlappable(MODAL_EVENT_THREAD_DISABLED);
            setNonModalMode(MODAL_EVENT_THREAD_DISABLED);
            return;
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 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 resolveGroup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean resolveGroup(boolean silent) {
        if (_groupId != null) {
            _group = (Radiogroup) Utils.getComponentById(this, _groupId);
            if (_group == null) {
                if (!silent)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Radio.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 removeRange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void removeRange(int fromIndex, int toIndex) {
        if (fromIndex > toIndex) {
            throw new UiException(
                    "fromIndex must less than toIndex: fromIndex: " + fromIndex + ", toIndex: " + toIndex);
        }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelList.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 updateByClient has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected void updateByClient(String name, Object value) {
        if ("start".equals(name)) {
            int start = value instanceof Number ? ((Number) value).intValue() : Integer.parseInt(Objects.toString(value));
            if (start < 0)
                throw new WrongValueException("Positive only");
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Frozen.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/Spinner.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