Showing 7,765 of 7,765 total issues

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

    public int getPageCount() {
        int size = getSize();
        if (size > 0 && _pageSize > 0) { //_pageSize default value is -1
            int pageCount = size / _pageSize;
            if (size % _pageSize == 0) {
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 beforeChildAdded has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

    public int getItemCount() {
        int sum = countItems(this);
        if (_externs != null)
            for (Radio radio : _externs) {
                if (!isRedudant(radio))
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 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 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/Groupbox.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

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

    private static Object[] getRealSymbols(Locale locale, Datebox box) {
        if (locale != null) {
            final String localeName = locale.toString();
            if (org.zkoss.zk.ui.impl.Utils.markClientInfoPerDesktop(box.getDesktop(),
                    box.getClass().getName() + localeName)) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Datebox.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 (_panelSpacing != null)
            render(renderer, "panelSpacing", _panelSpacing);
        if (!isTop())
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tabbox.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 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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public void render(final Radio item, final Object data, final int index) throws Exception {
            final Radiogroup cb = (Radiogroup) 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/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 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 restoreDynams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static void restoreDynams(Execution exec, Map<String, Object> old) {
        if (old != null)
            for (Map.Entry<String, Object> me : old.entrySet()) {
                final String nm = me.getKey();
                final Object val = me.getValue();
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 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 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/Treecol.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 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/Listcell.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