Showing 4,841 of 7,782 total issues

Method addForward0 has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean addForward0(String orgEvent, Object target, String targetEvent, Object eventData) {
        if (orgEvent == null)
            orgEvent = "onClick";
        else if (!Events.isValid(orgEvent))
            throw new IllegalArgumentException("Illegal event name: " + orgEvent);
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 cloneListeners has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        private void cloneListeners(AbstractComponent owner, AuxInfo clone) {
            if (listeners != null) {
                clone.listeners = new HashMap<String, List<EventListenerInfo>>(4);
                for (Map.Entry<String, List<EventListenerInfo>> me : listeners.entrySet()) {
                    final List<EventListenerInfo> list = new LinkedList<EventListenerInfo>();
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 insertBefore has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean insertBefore(Component newChild, Component refChild) {
        if ((newChild instanceof Macro) && ((Macro) newChild).isInline())
            return ((Macro) newChild).setInlineParent(this, refChild);

        checkParentChild(this, newChild); ///create _chdinf
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 loadBuild has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public static synchronized String loadBuild() {
        if (_build == null) {
            final String FILE = "/metainfo/zk/build";
            ClassLoader cl = Thread.currentThread().getContextClassLoader();
            InputStream is = null;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.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 mergeResponses has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    private List<AuResponse> mergeResponses(List<AuResponse> responses) {
        if (responses.size() >= 2) { // worth merging
            List<AuSetAttribute> bulk = new LinkedList<>();
            ListIterator<AuResponse> iterator = responses.listIterator();
            Object previousDepends = null, currentDepends = null;
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 clone has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public SimpleScope clone(Scope owner) {
        final SimpleScope clone = new SimpleScope(owner);
        if (_attrs != null) {
            clone._attrs = new HashMap<String, Object>();
            for (Map.Entry<String, Object> me : _attrs.entrySet()) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/SimpleScope.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 getVariableImpl has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        protected Variable getVariableImpl(String name, boolean recurse) throws UtilEvalError {
            //Note: getVariableImpl returns null if not defined,
            //while getVariable return Primitive.VOID if not defined

            //Tom M Yeh: 20060606:
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/scripting/bsh/BSHInterpreter.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 18 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean service(AuRequest request, boolean everError) {
        final String cmd = request.getCommand();
        if (cmd.startsWith(ON_BIND_COMMAND) || cmd.startsWith(ON_BIND_GLOBAL_COMMAND) || cmd.startsWith(ON_BIND_COMMAND_UPLOAD)) {
            final Map<String, Object> data = request.getData();
            String vcmd = data.get("cmd").toString();
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/BindComposer.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 coerceToBean has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public Object coerceToBean(Object val, Component comp, BindContext ctx) {
        Set<Object> vals = new LinkedHashSet<Object>();
        if (val != null) {
            final Tree tree = (Tree) comp;

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 18 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/PropertyImpl.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 18 (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();
        if (model != null && !(model instanceof Selectable)) {

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

    @SuppressWarnings("unchecked")
    public Object coerceToBean(Object val, Component comp, BindContext ctx) {
        Set<Object> vals = new LinkedHashSet<Object>();
        if (val != null) {
            final Listbox lbx = (Listbox) comp;

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

    @SuppressWarnings("unchecked")
    public void load(BindContext ctx) {
        final Component comp = getComponent(); //ctx.getComponent();
        final BindEvaluatorX eval = getBinder().getEvaluatorX();
        final BindingExecutionInfoCollector collector = ((BinderCtrl) getBinder()).getBindingExecutionInfoCollector();
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/InitChildrenBindingImpl.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 equals has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/WrongValuePropertyImpl.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 onEvent0 has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        private void onEvent0(Event event) throws Exception {
            //command need to be confirmed shall be execute first!
            //must sort the command sequence?

            //BUG 619, event may come from children of some component,
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 setRowRenderer has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public void setRowRenderer(RowRenderer<?> renderer) {
        if (_renderer != renderer) {
            _renderer = renderer;

            if (_model != 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 ungroup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public void ungroup(boolean ascending) {
        final Comparator<?> cmpr = ascending ? _sortAsc : _sortDsc;
        if (cmpr != null) {

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

    private boolean removePartial(Collection<?> c, boolean isRemove) {
        int sz = c.size();
        int removed = 0;
        int retained = 0;
        int index = 0;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelSet.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 setParent has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public void setParent(Component parent) {
        Radiogroup oldgp = null;

        if (getParent() != null)
            oldgp = getRadiogroup();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Radio.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 setItemRenderer has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public void setItemRenderer(ListitemRenderer<?> renderer) {
        if (_renderer != renderer) {
            _renderer = renderer;

            if (_model != null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.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