Showing 7,775 of 7,775 total issues

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

    public void clearKeyMessages(Component comp, String key) {
        List<Message> compMsgs = _compMsgsMap.get(comp);
        if (compMsgs == null || compMsgs.size() == 0) {
            return;
        }
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/ValidationMessagesImpl.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 addPropertySaveBindings has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void addPropertySaveBindings(Component comp, String attr, String saveExpr, String[] beforeCmds,
            String[] afterCmds, Map<String, Object> bindingArgs, String converterExpr,
            Map<String, Object> converterArgs, String validatorExpr, Map<String, Object> validatorArgs) {
        checkInit();
        if (saveExpr == null) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.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 clearMessages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void clearMessages(Component comp, String attr) {
        List<Message> compMsgs = _compMsgsMap.get(comp);
        if (compMsgs == null || compMsgs.size() == 0) {
            return;
        }
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/ValidationMessagesImpl.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 doSaveEvent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    boolean doSaveEvent(BindingKey bkey, Component comp, Event evt, Set<Property> notifys) {
        final List<SavePropertyBinding> bindings = _saveEventBindings.get(bkey);
        if (bindings != null) {
            boolean valid = true;
            for (SavePropertyBinding binding : bindings) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/PropertyBindingHandler.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/Grid.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 getAllTrackerNodes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected Collection<TrackerNode> getAllTrackerNodes() {
        Set<TrackerNode> all = null;
        final Collection<Map<Object, TrackerNode>> nodesMaps = _compMap.values();
        if (nodesMaps != null && !nodesMaps.isEmpty()) {
            all = new LinkedHashSet<TrackerNode>();
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.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 getDependents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private Set<TrackerNode> getDependents(Set<TrackerNode> parentnodes, String prop) {
        final Set<TrackerNode> kidnodes = new LinkedHashSet<TrackerNode>();
        for (TrackerNode node : parentnodes) {
            for (TrackerNode kid : node.getDependents(prop)) {
                if (kid != null) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.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 Selectbox clone = (Selectbox) super.clone();
        if (clone._model != null) {
            if (clone._model instanceof ComponentCloneListener) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Selectbox.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 initDataListener has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void initDataListener() {
        if (_dataListener == null)
            _dataListener = new ListDataListener() {
                public void onChange(ListDataEvent event) {
                    // ZK-1864: share listmodelist cause un-predictable reload
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.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 getTypeName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("rawtypes")
    static String getTypeName(Class type) {
        if (type.isArray()) {
            try {
                Class cl = type;
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/MiscUtil.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 removeTrackings has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void removeTrackings(Set<Component> comps) {
        final Set<TrackerNode> removed = new LinkedHashSet<TrackerNode>();
        for (Component comp : comps) {
            final Map<Object, TrackerNode> nodesMap = _compMap.remove(comp);
            if (nodesMap != null) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.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 handleComponentAttached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected void handleComponentAttached(Component comp) {
        //ZK-2022, check if this component is in queue for removal 
        //if yes, then post and do processing later
        boolean removeMark = Boolean.TRUE.equals(comp.getAttribute(REMOVE_MARK));
        if (removeMark) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/BindUiLifeCycle.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 renderProperties has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
        super.renderProperties(renderer);

        if (_title.length() > 0)
            render(renderer, "title", _title);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Panel.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 fixSelected has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean fixSelected() {
        Treeitem sel = null;
        switch (_selItems.size()) {
        case 1:
            sel = _selItems.iterator().next();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.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 Combobox clone = (Combobox) super.clone();
        clone._selItem = null;
        clone.schedSyncValueToSelection();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.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 shallVisitTree has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean shallVisitTree(Tree tree, Component child) {
        final Treeitem item = (Treeitem) child;
        int count = item.isOpen() && item.getTreechildren() != null ? item.getTreechildren().getVisibleItemCount() : 0;
        Integer visited = (Integer) tree.getAttribute(Attributes.VISITED_ITEM_COUNT);
        final Paginal pgi = tree.getPaginal();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treeitem.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 getPath0 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private int[] getPath0(Treechildren parent, int index) {
        List<Integer> path = new LinkedList<Integer>();
        path.add(index);
        Component p = parent;
        while (true) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.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 onPageAttached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void onPageAttached(Page newpage, Page oldpage) {
        super.onPageAttached(newpage, oldpage);
        if (oldpage == null) {
            //prepare a right moment to init Tree(must be as early as possible)
            this.addEventListener("onInitModel", _modelInitListener = new ModelInitListener());
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.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 fixSelectedSet has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void fixSelectedSet() {
        _sel = null;
        _selItems.clear();
        for (Treeitem item : getItems()) {
            if (item.isSelected()) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.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

        @SuppressWarnings("unchecked")
        private void render(Treeitem item, Object node, 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/Tree.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