Showing 4,841 of 7,782 total issues

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 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 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 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 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 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 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 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 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 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 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 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

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

    public void onClose(Event evt) {
        try {
            if (evt.getData() == null)
                _result.clear();
            else {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/FileuploadDlg.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 setSelectedText has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public void setSelectedText(int start, int end, String newtxt, boolean isHighLight) {
        if (start <= end) {
            final String txt = getText();
            final int len = txt.length();
            if (start < 0)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/InputElement.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 setThreadLocals has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private void setThreadLocals() {
        if (_threadLocals != null) {
            try {
                Class cls = Classes

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 getContentType has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String getContentType(String path) {
        if (path == null)
            return null;

        int j = path.lastIndexOf('.');
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/Interpreter.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