Showing 7,775 of 7,775 total issues

Method setMold has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void setMold(String mold) {
        if (isVertical()) {
            if (mold.startsWith("scale")) {
                throw new WrongValueException("Unsupported vertical orient in mold : " + mold);
            } else {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Slider.java - About 35 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 setMultiple has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void setMultiple(boolean multiple) {
        if (_multiple != multiple) {
            _multiple = multiple;
            fireEvent(TreeDataEvent.MULTIPLE_CHANGED, null, -1, -1);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java - About 35 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 addOpenPaths has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean addOpenPaths(int[][] paths) {
        boolean added = false;
        final int len = paths != null ? paths.length : 0;
        for (int j = 0; j < len; ++j) {
            if (paths[j] != null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java - About 35 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 setRadiogroup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void setRadiogroup(Radiogroup radiogroup) {
        boolean inGroup = _groupId != null;
        _groupId = null;
        if (inGroup || radiogroup != _group) {
            _explictGroup = radiogroup != null;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Radio.java - About 35 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 setMold has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void setMold(String mold) {
        if (isVertical()) {
            if (mold.startsWith("accordion")) {
                throw new WrongValueException("Unsupported vertical orient in mold : " + mold);
            } else {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 35 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 getMedia has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        public Media getMedia(String pathInfo) {
            if (pathInfo != null) {
                int j = pathInfo.indexOf('/', 1);
                if (j >= 0) {
                    int k = pathInfo.indexOf('/', ++j);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Image.java - About 35 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 getLabel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public String getLabel() {
        final Component cell = getFirstChild();
        if (cell != null) {
            if (cell instanceof Label)
                return ((Label) cell).getValue();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Groupfoot.java - About 35 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 setValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public <T> void setValue(T value) {
        if (!Objects.equals(_value, value)) {
            _value = value;

            final Listbox listbox = getListbox();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listitem.java - About 35 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 removeSelectionPaths has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean removeSelectionPaths(int[][] paths) {
        boolean found = false;
        final int len = paths != null ? paths.length : 0;
        for (int j = 0; j < len && !_selection.isEmpty(); ++j) {
            final Path path = new Path(paths[j]);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java - About 35 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 setSelectAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        public void setSelectAll(boolean selectAll) {
            if (selectAll) {
                List<E> all = new LinkedList<>();
                List<E> allNodes = model.getAllNodes();
                for (E o : allNodes) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java - About 35 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 arrayToString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String arrayToString(Object[] ary) {
        if (ary == null || ary.length == 0)
            return "";

        final StringBuffer sb = new StringBuffer(50);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/Utils.java - About 35 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 onPageDetached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void onPageDetached(Page page) {
        super.onPageDetached(page);
        if (_model != null && _dataListener != null)
            _model.removeListDataListener(_dataListener);
        if (_model instanceof PageableModel && _pgListener != null)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("rawtypes")
    public Object clone() {
        final Listbox clone = (Listbox) super.clone();
        clone.init();

Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public Object clone() {
        SimpleGroupsModel clone = (SimpleGroupsModel) super.clone();
        if (_data != null)
            clone._data = new ArrayList(_data);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/SimpleGroupsModel.java - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void render(Page page, Writer out) throws IOException {
        final Execution exec = Executions.getCurrent();
        final String ctl = ExecutionsCtrl.getPageRedrawControl(exec);
        boolean au = exec.isAsyncUpdate(null);
        if (!au && (page.isComplete() || "complete".equals(ctl))) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/PageRenderer.java - About 35 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 getMedia has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        public Media getMedia(String pathInfo) {
            if (pathInfo != null) {
                int j = pathInfo.indexOf('/', 1);
                if (j >= 0) {
                    int k = pathInfo.indexOf('/', ++j);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java - About 35 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 renderDesktop has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected void renderDesktop(Execution exec, Page page, Writer out) throws IOException {
        HtmlPageRenders.setContentType(exec, page);

        final PageCtrl pageCtrl = (PageCtrl) page;
        write(out, HtmlPageRenders.outFirstLine(exec, page)); //might null
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/PageRenderer.java - About 35 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 selectItem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void selectItem(Listitem item) {
        if (item == null) {
            setSelectedIndex(-1);
        } else {
            if (item.getParent() != this)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 35 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 fixRefChildForHeader has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private Component fixRefChildForHeader(Component refChild) {
        if (refChild != null && refChild.getParent() != this)
            refChild = null;

        // try the first listitem
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 35 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 equals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        public boolean equals(Object obj) {

            if (obj instanceof String) {
                return Objects.equals(popupString, obj);
            } else if (obj instanceof Popup) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java - About 35 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