Showing 4,841 of 7,782 total issues

Method sessionDidActivate has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public void sessionDidActivate(Page page) {
        _page = page;

        Set<Object> uniqueAttrs = new LinkedHashSet<Object>(); //ZK-2701: use set to record unique attrs and listeners
        if (_auxinf != null && _auxinf.attrs != null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 2 hrs 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 removeEventListener has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean removeEventListener(String evtnm, EventListener<? extends Event> listener) {
        if (evtnm == null || listener == null)
            throw new NullPointerException();

        if (_listeners != null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java - About 2 hrs 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 visualizeErrors has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private final void visualizeErrors(Execution exec, UiVisualizer uv, List<Throwable> errs) {
        final StringBuffer sb = new StringBuffer(128);
        for (Throwable t : errs) {
            if (sb.length() > 0)
                sb.append('\n');
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 2 hrs 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 17 (exceeds 5 allowed). Consider refactoring.
Open

        public Object get(ContextType type) {
            switch (type) {
            //bind contexts
            case BIND_CONTEXT:
                return _bindContext;
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/ParamCall.java - About 2 hrs 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 coerceToUi has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public Object coerceToUi(Object val, Component comp, BindContext ctx) {
        Listbox lbx = (Listbox) comp;
        final ListModel<?> model = lbx.getModel();
        //ZK-762 selection of ListModelList is not correct if binding to selectedItem

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

    @SuppressWarnings("unchecked")
    public Object coerceToUi(Object val, Component comp, BindContext ctx) {
        Combobox cbx = (Combobox) comp;
        final ListModel<?> model = cbx.getModel();
        //ZK-762 selection of ListModelList is not correct if binding to selectedItem

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

    @SuppressWarnings("unchecked")
    public Object coerceToUi(Object val, Component comp, BindContext ctx) {
        Radiogroup radiogroup = (Radiogroup) comp;
        final ListModel<?> model = radiogroup.getModel();
        //ZK-762 selection of ListModelList is not correct if binding to selectedItem

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

    public void addFormAssociatedSaveBinding(Component associatedComp, String formId, SaveBinding saveBinding,
            String fieldName) {
        checkInit();
        //find the form component by form id and a associated/nested component
        Component formComp = lookupAssociatedFormComponent(formId, associatedComp);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 2 hrs 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 doExecute has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected void doExecute(Component comp, String command, Map<String, Object> commandArgs, BindContext ctx,
            Set<Property> notifys) {
        try {
            Matcher matcher = CALL_OTHER_VM_COMMAND_PATTERN.matcher(command);
            if (matcher.find()) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 2 hrs 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 remove has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

        public void remove(Object bean) {
            EqualBeans equalBeans = _innerMap.remove(bean);
            if (equalBeans != null) {
                _identityMap.remove(bean);
                removeFromEqualBeansAndReput(equalBeans, bean);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 2 hrs 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 getOrCreateTrackerNode has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected TrackerNode getOrCreateTrackerNode(Component comp, String[] series) {
        Map<Object, TrackerNode> nodes = _compMap.get(comp);

        TrackerNode parentNode = null;
        for (String script : series) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 2 hrs 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 renderItemByPath has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public Treeitem renderItemByPath(int[] path) {
        if (path == null || path.length == 0)
            return null;
        // Start from root-Tree
        Treeitem ti = null;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 2 hrs 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 redrawChildren has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected void redrawChildren(Writer out) throws IOException {
        Tree tree = getTree();
        if (!tree.inPagingMold()) {
            super.redrawChildren(out);
        } else if (isRealVisible() && shallVisitTree(tree, this)) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treeitem.java - About 2 hrs 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 selectTabDirectly has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    /* packge */void selectTabDirectly(Tab tab, boolean byClient) {
        if (tab == null)
            throw new IllegalArgumentException("null tab");
        if (tab.getTabbox() != this)
            throw new UiException("Not my child: " + tab);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 2 hrs 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 17 (exceeds 5 allowed). Consider refactoring.
Open

        public void render(final Listitem item, final Object data, final int index) {
            final Listbox listbox = (Listbox) item.getParent();
            Template tm = listbox.getTemplate("model");
            GroupingInfo info = null;
            if (item instanceof Listgroup) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java - About 2 hrs 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 17 (exceeds 5 allowed). Consider refactoring.
Open

        public void render(final Row row, final Object data, final int index) {
            final Rows rows = (Rows) row.getParent();
            final Grid grid = (Grid) rows.getParent();
            Template tm = getTemplate(grid, rows, "model");
            GroupingInfo info = null;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java - About 2 hrs 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 17 (exceeds 5 allowed). Consider refactoring.
Open

    public void service(HttpServletRequest request, HttpServletResponse response, String path)
            throws ServletException, IOException {
        String resourceCache = Library.getProperty("org.zkoss.zk.WCS.cache");
        if (resourceCache != null && "false".equalsIgnoreCase(resourceCache))
            _cache.clear();
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/util/resource/DspExtendlet.java - About 2 hrs 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

Function _bc_do_sub has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    _bc_do_sub: function(a, b, c) {
        var d, e, g, f, h, k, l, m, n;
        e = libbcmath.MAX(a.n_len, b.n_len);
        d = libbcmath.MAX(a.n_scale, b.n_scale);
        f = libbcmath.MIN(a.n_len, b.n_len);
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 2 hrs 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

Function _onResponseReady has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

        export function _onResponseReady(response: Response): void {
            var reqInf = zAu.ajaxReqInf, sid: string | undefined;
            try {
                if (response) {
                    zAu.ajaxReq = zAu.ajaxReqInf = undefined;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - About 2 hrs 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

Function onURLChange has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    onURLChange(): void { //called by mount.js
        try {
            const ifr = window.frameElement as HTMLIFrameElement;
            if (!parent || parent == window || !ifr) //not iframe
                return;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/bookmark.ts - About 2 hrs 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