Showing 4,841 of 7,782 total issues

Method put has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public V put(K key, V value) {
        if (key == null) {
            key = (K) KeyFactory.NULL;
        }

Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.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 cleanup has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private void cleanup() {
        // Cleanup after cleared References.
        Entry[] tab = this.table;
        ReferenceQueue queue = this.queue;
        Reference ref;
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.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 get has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public V get(Object key) {
        if (key == null) {
            key = KeyFactory.NULL;
        }

Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.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 getEqualBeans has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        public Set<Object> getEqualBeans(Object bean) {
            boolean doSync = false;
            EqualBeans equalBeans;
            if (bean instanceof Collection) {
                equalBeans = _identityMap.get(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 render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        /*package*/ @SuppressWarnings("unchecked")
        void render(Row row, int index) throws Throwable {
            if (row.isLoaded())
                return; //nothing to do

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

    private void doSelectionChanged() {
        final Selectable<Object> smodel = getSelectableModel();
        if (smodel.isSelectionEmpty()) {
            if (_selItem != null)
                setSelectedItem(null);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.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 getRegex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private Pattern getRegex(String regex, String regexFlags) {
        if (regex == null || regex.length() == 0)
            return null;
        if (regexFlags.length() == 0) {
            return Pattern.compile(regex);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.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 removeItemFromSelection has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public void removeItemFromSelection(Treeitem item) {
        if (item.getTree() != this)
            throw new UiException("Not a child: " + item);

        if (item.isSelected()) {
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 getClientConstraint has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public String getClientConstraint() {
        if (_raw != null)
            return '\'' + Encode.forJavaScript(_raw) + '\'';

        final StringBuffer sb = new StringBuffer("new zul.inp.SimpleConstraint(");
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.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 setModel has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public void setModel(ListModel<?> model) {
        if (model != null) {
            if (!(model instanceof Selectable))
                throw new UiException(model.getClass() + " must implement " + Selectable.class);

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

    private void include(Writer out) throws IOException {
        final Desktop desktop = getDesktop();
        final Execution exec = getExecution();
        final String src = exec.toAbsoluteURI(_src, false);
        final Map<String, Object> old = setupDynams(exec);
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 getGroupIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static int getGroupIndex(List<int[]> groupInfo, int index) {
        int j = 0, gindex = -1;
        int[] g = null;
        for (Iterator<int[]> it = groupInfo.iterator(); it.hasNext(); ++j) {
            g = it.next();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Group.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 getGroupIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static int getGroupIndex(List<int[]> groupInfo, int index) {
        int j = 0, gindex = -1;
        int[] g = null;
        for (Iterator<int[]> it = groupInfo.iterator(); it.hasNext(); ++j) {
            g = it.next();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listgroup.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 getGroupIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ int getGroupIndex(int index) {
        int j = 0, gindex = -1;
        int[] g = null;
        for (Iterator<int[]> it = _groupsInfo.iterator(); it.hasNext(); ++j) {
            g = it.next();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rows.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 fixSiblings has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private void fixSiblings(boolean checked, boolean byclient) {
        final Radiogroup group = getRadiogroup();
        if (group != null) {
            if (checked) {
                final Radio sib = group.getSelectedItem();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Radio.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 12 (exceeds 5 allowed). Consider refactoring.
Open

    private void fixSelectedIndex(int j) {
        if (!_selItems.isEmpty()) {
            int realj = getRealIndex(j);
            if (realj < 0)
                realj = 0;
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 getGroupIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    /* package */int getGroupIndex(int index) {
        int j = 0, gindex = -1;
        int[] g = null;
        for (Iterator<int[]> it = _groupsInfo.iterator(); it.hasNext(); ++j) {
            g = it.next();
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 compare0 has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private int compare0(Object o1, Object o2, String fieldname, boolean asc, String func)
            throws NoSuchMethodException {
        // Bug B50-3183438: Access to bean shall be consistent
        final Object f1 = o1 instanceof Map ? ((Map) o1).get(fieldname)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/FieldComparator.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 onEvent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        public void onEvent(Event event) throws Exception {
            if (_modelInitListener != null) {
                Listbox.this.removeEventListener("onInitModel", _modelInitListener);
                _modelInitListener = null;
            }
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 readObject has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("rawtypes")
    private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
        s.defaultReadObject();

        _model = (ListModel) s.readObject();
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

Severity
Category
Status
Source
Language