Showing 4,841 of 7,782 total issues

Method parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean parse(Attribute attr, ComponentInfo compInfo, PageDefinition pgdef) throws Exception {
        if (!(compInfo instanceof NativeInfo) && "".equals(attr.getNamespaceURI()))
            return false; // not what we care.

        final String name = attr.getLocalName();
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/ClientBinderCommandParser.java - About 25 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 evaluate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Object evaluate(XelContext ctx) throws XelException {
        try {
            if (cmp instanceof ComponentCtrl) {
                PropertyAccess propertyAccess = ((ComponentCtrl) cmp).getPropertyAccess(field);
                if (propertyAccess != null)
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/PropertyExpression.java - About 25 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 getTracker has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public Tracker getTracker() {
        if (_tracker == null) {
            String clznm = Library.getProperty("org.zkoss.bind.Tracker.class");
            if (clznm != null) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 25 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 getRenderer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected Object getRenderer(String name) {
        Object renderer = RENDERERS.get(name);
        if (renderer == null && name.indexOf('.') > 0) { //might be a class path
            try {
                renderer = Classes.newInstanceByThread(name);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 25 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 doCommand has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private int doCommand(Component comp, CommandBinding commandBinding, String command, Event evt,
            Map<String, Object> commandArgs, Set<Property> notifys) {
        final String evtnm = evt == null ? null : evt.getName();
        String debugInfo = MessageFormat.format("doCommand "
                + "comp=[{0}],command=[{1}],evtnm=[{2}]", comp, command, evtnm);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 25 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 removeBindings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void removeBindings(Component comp, String key) {
        checkInit();
        removeEventCommandListenerIfExists(comp, key); //_listenerMap; //comp+evtnm -> eventlistener

        final BindingKey bkey = getBindingKey(comp, key);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 25 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 toCollectedProperties has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    Map<String, Property[]> toCollectedProperties(Set<Property> validates) {
        if (validates == null || validates.size() == 0)
            return Collections.emptyMap();
        Map<String, List<Property>> temp = new HashMap<String, List<Property>>(validates.size());

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

    private static String formatLocationMessage(String message, Location loc, boolean showColumn) {
        if (loc == null)
            return message;
        String path = loc.getPath();
        int ln = loc.getLineNumber();
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/MiscUtil.java - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Set<TrackerNode> getDependents(Object property) {
        LinkedHashSet<TrackerNode> set = new LinkedHashSet<TrackerNode>(5);
        TrackerNode kid = getDependent0(property);
        if (kid != null) {
            set.add(kid);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerNodeImpl.java - About 25 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 dumpCompMap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void dumpCompMap(boolean dumpNodes) {
        System.out.println("******* _compMap: *********");
        System.out.println("******* size: " + _compMap.size());
        for (Component comp : _compMap.keySet()) {
            System.out.println("comp:" + comp + "------------");
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 25 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 tieProperty has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void tieProperty(Object property, TrackerNode trackerNode) {
        final Object oldNode = _brackets.get(property);
        if (trackerNode.equals(oldNode)) {
            return;
        }
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerNodeImpl.java - About 25 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 readObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

        boolean b = s.readBoolean();
        if (b) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Column.java - About 25 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 dumpNullMap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void dumpNullMap(boolean dumpNodes) {
        System.out.println("******* _nullMap: *********");
        System.out.println("******* size: " + _nullMap.size());
        for (Object field : _nullMap.keySet()) {
            System.out.println("field:" + field + "------");
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 25 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 collectDependents0 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private Set<TrackerNode> collectDependents0(Set<TrackerNode> nodes) {
        final Set<TrackerNode> kids = getDirectDependents();
        nodes.addAll(kids);
        for (TrackerNode kid : kids) {
            ((TrackerNodeImpl) kid).collectDependents0(nodes); //recursive
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerNodeImpl.java - About 25 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 setActive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void setActive(int childIndex) {
        List<Component> children = getChildren();
        int nChild = children.size();
        if (childIndex < 0 || childIndex >= nChild)
            throw new WrongValueException("Out of bound: " + childIndex + " while size=" + nChild);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Menupopup.java - About 25 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 getColumn has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Column getColumn() {
        final Grid grid = getGrid();
        if (grid != null) {
            final Columns cs = grid.getColumns();
            if (cs != null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Footer.java - About 25 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 service has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
        final String cmd = request.getCommand();
        if (cmd.equals(Events.ON_CHECK)) {
            CheckEvent evt = CheckEvent.getCheckEvent(request);
            if ("tristate".equals(getMold())) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Checkbox.java - About 25 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 getValidator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private Validator getValidator() throws Exception {
        if (_target.get() == null) {
            synchronized (this) {
                if (_target.get() == null) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/validator/DeferredValidator.java - About 25 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 syncInnerMap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        private void syncInnerMap(EqualBeans equalBeans, Object bean) {
            //hashCode of bean has changed, must reset
            boolean found = false;
            final WeakHashMap<Object, EqualBeans> newMap = new WeakHashMap<Object, EqualBeans>(_innerMap.size());
            //ZK-781. Copy one by one to reset _innerMap
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

        public String render(final Component owner, final Object data, final int index) {
            final Selectbox self = (Selectbox) owner;
            final Template tm = self.getTemplate("model");
            if (tm == null)
                return Objects.toString(data);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Selectbox.java - About 25 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