Showing 4,841 of 7,782 total issues

Method unsubscribe has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean unsubscribe(EventListener<T> listener) {
        if (listener != null)
            for (Iterator<ListenerInfo<T>> it = _listenerInfos.iterator(); it.hasNext();) {
                final ListenerInfo<T> inf = it.next();
                if (listener.equals(inf.listener)) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/impl/DesktopEventQueue.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 parsePI has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private static void parsePI(LanguageDefinition langdef, Document doc) throws Exception {
        for (Iterator it = doc.getChildren().iterator(); it.hasNext();) {
            final Object o = it.next();
            if (!(o instanceof ProcessingInstruction))
                continue;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.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 handleError has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private void handleError(Session sess, HttpServletRequest request, HttpServletResponse response, String path,
            Throwable err) throws ServletException, IOException {
        Utils.resetOwner();

        // ZK-3679
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutServlet.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 toComposer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private static void toComposer(List<Composer> composers, Page page, Object o) throws Exception {
        if (o instanceof String) {
            final String s = (String) o;
            if (s.indexOf(',') >= 0)
                o = CollectionsX.parse(null, s, ','); //No EL
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ComponentInfo.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 evalProperties has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public Map<String, Object> evalProperties(Map<String, Object> propmap, Page owner, Component parent) {
        if (propmap == null)
            propmap = new HashMap<String, Object>();

        if (_props != null) {

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

    public static void sort(List<? extends Component> list, int from, int to, Comparator<? super Component> cpr) {
        final Component[] ary = CollectionsX.toArray(list, new Component[0], from, to);
        Arrays.sort(ary, cpr);

        ListIterator<? extends Component> it = list.listIterator(from);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/Components.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 writeObject has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
        //No need to unshare annots and evthds, since stored as an independent copy

        s.defaultWriteObject();

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

    private static void checkParentChild(Component parent, Component child) throws UiException {
        if (child == null)
            throw new UiException("Child cannot be null");
        if (parent != null) {
            final AbstractComponent acp = (AbstractComponent) parent;
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 getDefinition has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ static ComponentDefinition getDefinition(Execution exec, Class<? extends Component> cls) {
        if (exec != null) {
            final ExecutionCtrl execCtrl = (ExecutionCtrl) exec;
            final PageDefinition pgdef = execCtrl.getCurrentPageDefinition();
            final Page page = execCtrl.getCurrentPage();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/Impls.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 destroy has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public void destroy() {
        Visualizer visualizer = null;
        try {
            if (_desktop != null) {
                Execution execution = _desktop.getExecution();
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 evalDeferredZScripts has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private void evalDeferredZScripts(Interpreter ip, String zslang) {
        if (_zsDeferred != null) {
            for (Iterator<Object[]> it = _zsDeferred.iterator(); it.hasNext();) {
                final Object[] zsInfo = it.next();
                final ZScript zscript = (ZScript) zsInfo[1];
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 addMoved has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public void addMoved(Component comp, Component oldparent, Page oldpg, Page newpg) {
        if (_recovering || _disabled || (newpg == null && oldpg == null)
                || (newpg == null && (oldpg instanceof VolatilePage || !_exec.isAsyncUpdate(oldpg))) //detach from loading pg
                || (oldpg == null && (newpg instanceof VolatilePage || !_exec.isAsyncUpdate(newpg))) //attach to loading pg
                || isCUDisabled(comp) || (oldparent != null && isCUDisabled(oldparent)))
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.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 readObject has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

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

        init();

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

    private static final void doDeactivate(Execution exec) {
        //        if (log.finerable()) log.finer("Deactivating "+desktop);

        final ExecutionCtrl execCtrl = (ExecutionCtrl) exec;
        final Desktop desktop = exec.getDesktop();
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 desktopDestroyed0 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private void desktopDestroyed0(Desktop desktop) {
        final Configuration config = _wapp.getConfiguration();
        if (!_suspended.isEmpty()) { //no need to sync (better performance)
            final Map<Object, List<EventProcessingThreadImpl>> map;
            synchronized (_suspended) {
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 storeForm has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public void storeForm(Component comp, String id, Form form) {
        final String oldid = (String) comp.getAttribute(FORM_ID, Component.COMPONENT_SCOPE);
        //check if a form exist already, allow to store a form with same id again for replacing the form
        if (oldid != null && !oldid.equals(id)) {
            throw new IllegalArgumentException(
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 loadComponentProperties0 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private void loadComponentProperties0(Component comp, boolean loadinit) {

        final Map<String, List<Binding>> compBindings = _bindings.get(comp);
        if (compBindings != null) { // if component is not registered in this binder, do nothing.
            for (String key : compBindings.keySet()) {
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 mergeExceptionInfo has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static RuntimeException mergeExceptionInfo(Exception ex, Object loc) {
        Location location = null;
        boolean showColumn = true;
        if (loc instanceof Component) {
            location = toComponentLocation((Component) loc);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/MiscUtil.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 onEvent has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

        public void onEvent(Event event) throws Exception {
            if (_modelInitListener != null) {
                Grid.this.removeEventListener("onInitModel", _modelInitListener);
                _modelInitListener = null;
            }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.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 renderChangedItem has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

        @SuppressWarnings("unchecked")
        private void renderChangedItem(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 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