Showing 7,775 of 7,775 total issues

Method removeChild has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean removeChild(Component child) {
        if (_paging == child && _pgi == child && inPagingMold())
            throw new IllegalStateException(
                    "The paging component cannot be removed manually. It is removed automatically when changing the mold");
        //Feature 1906110: prevent developers from removing it accidently
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.java - About 1 hr 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 setSortDirection has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public void setSortDirection(String sortDir) throws WrongValueException {
        if (sortDir == null
                || (!"ascending".equals(sortDir) && !"descending".equals(sortDir) && !"natural".equals(sortDir)))
            throw new WrongValueException("Unknown sort direction: " + sortDir);
        if (!Objects.equals(_sortDir, sortDir)) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Column.java - About 1 hr 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 dumpBeanMap has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private void dumpBeanMap(boolean dumpNodes) {
        System.out.println("******* _beanMap: *********");
        System.out.println("******* size: " + _beanMap.size());
        for (Object bean : _beanMap.keySet()) {
            System.out.println("bean:" + bean + "------------");
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 1 hr 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 addVisibleItemCount has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    void addVisibleItemCount(int count) {
        if (inPagingMold()) {
            Paginal pgi = getPaginal();
            int totalSize = pgi.getTotalSize() + count;
            //ZK-3173: if visible item count reduces, active page might exceed max page count
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 1 hr 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 setSortDirection has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public void setSortDirection(String sortDir) throws WrongValueException {
        if (sortDir == null
                || (!"ascending".equals(sortDir) && !"descending".equals(sortDir) && !"natural".equals(sortDir)))
            throw new WrongValueException("Unknown sort direction: " + sortDir);
        if (!Objects.equals(_sortDir, sortDir)) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listheader.java - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean insertBefore(Component newChild, Component refChild) {
        if (newChild instanceof Detail) {
            //move to the first child
            refChild = getChildren().isEmpty() ? null : getChildren().get(0);
            if (super.insertBefore(newChild, refChild)) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Row.java - About 1 hr 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 getAt has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private static Radio getAt(Component comp, MutableInteger cur, int index) {
        for (Iterator it = comp.getChildren().iterator(); it.hasNext();) {
            final Component child = (Component) it.next();
            if (child instanceof Radio) {
                if (cur.value++ == index)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 1 hr 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 smartDrawCaptcha has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected void smartDrawCaptcha() {
        if (_smartDrawCaptcha) { //already mark smart draw
            return;
        }
        _smartDrawCaptcha = true;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Captcha.java - About 1 hr 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 fixSelIndex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private static int fixSelIndex(Component comp, MutableInteger cur) {
        for (Iterator it = comp.getChildren().iterator(); it.hasNext();) {
            final Component child = (Component) it.next();
            if (child instanceof Radio) {
                if (((Radio) child).isSelected())
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 1 hr 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 applyChangesToContent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private void applyChangesToContent() {
        if (_src == null) {
            if (!getChildren().isEmpty())
                getChildren().clear();
            else if (!_instantMode && getChildPage() != null)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Include.java - About 1 hr 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 fixSelectedIndex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ void fixSelectedIndex() {
        final MutableInteger cur = new MutableInteger(0);
        _jsel = fixSelIndex(this, cur);

        if (_jsel < 0 && _externs != null)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 1 hr 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 getPath has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public int[] getPath(TreeNode<E> child) {
        final TreeNode<E> root = getRoot();
        List<Integer> p = new ArrayList<Integer>();
        while (root != child) {
            TreeNode<E> parent = child.getParent();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/DefaultTreeModel.java - About 1 hr 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 service has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
        final String cmd = request.getCommand();
        if (cmd.equals(Events.ON_OPEN)) {
            OpenEvent evt = OpenEvent.getOpenEvent(request);
            setVisible(evt.isOpen());
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Window.java - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
Open

        @SuppressWarnings("unchecked")
        public ListModel<E> getSubModel(Object value, int nRows) {
            final List<E> data = new LinkedList<E>();
            final Set<E> selection = new LinkedHashSet<E>();
            nRows = nRows < 0 ? _nRows : nRows;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModels.java - About 1 hr 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 setSortDirection has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public void setSortDirection(String sortDir) throws WrongValueException {
        if (sortDir == null
                || (!"ascending".equals(sortDir) && !"descending".equals(sortDir) && !"natural".equals(sortDir)))
            throw new WrongValueException("Unknown sort direction: " + sortDir);
        if (!Objects.equals(_sortDir, sortDir)) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treecol.java - About 1 hr 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 parseConstraint has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected int parseConstraint(String constraint) throws UiException {
        int minIndex = constraint.indexOf("min");
        int maxIndex = constraint.indexOf("max");

        try {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/SimpleDoubleSpinnerConstraint.java - About 1 hr 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 setPageSize has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public void setPageSize(int size) throws WrongValueException {
        if (size < 0) {
            throw new WrongValueException("expecting positive non zero value, got: " + size);
        }
        
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java - About 1 hr 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 verifyPrefix has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        private boolean verifyPrefix(int[] path, int update) {
            if (path.length > this.path.length)
                return false;
            int i = 0;
            for (; i < path.length; i++) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java - About 1 hr 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 hasNext has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        public boolean hasNext() {
            if (!inPagingMold())
                return _it.hasNext();

            if (!_isBeginning && _count >= getPaginal().getPageSize()) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr 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 getRealFormat has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public String getRealFormat() {
        final String format = getFormat();
        if (format == null || format.length() == 0)
            return getDefaultFormat(); //backward compatible

Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Datebox.java - About 1 hr 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