Showing 4,841 of 7,782 total issues

Method setValue has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public void setValue(ELContext context, Object base, Object property, Object value)
            throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException {
        if (context == null) {
            throw new NullPointerException();

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

    protected Object resolveParameter0(Object val, Class<?> returnType) {
        if (val != null && returnType.isAssignableFrom(val.getClass())) { //escape
            return val;
        } else if (Component.class.isAssignableFrom(returnType) && val instanceof String) {
            return _root.getDesktop().getComponentByUuidIfAny((String) val);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/ParamCall.java - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public Object coerceToUi(Object val, C comp, BindContext ctx) {
        if (val == null) {
            val = new ArrayList();
        }

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

        private static byte[] readClass(final InputStream is) throws IOException {
            if (is == null) {
                throw new IOException("Class not found");
            }
            try {

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

    private boolean doValidateSaveEvent(Component comp, SavePropertyBinding binding, Event evt, Set<Property> notifys) {
        //for a single binding, if it doesn't need to do validation, then we don't need to anything.
        if (binding.hasValidator()) {
            final BindContext ctx = BindContextUtil.newBindContext(_binder, binding, true, null, binding.getComponent(),
                    evt);

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

        public void onEvent(Event event) {
            if (_rows != null && _model != null && inPagingMold()) {
                //theoretically, _rows shall not be null if _model is not null when
                //this method is called. But, just in case -- if sent manually
                final Paginal pgi = getPaginal();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.java - About 1 hr 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 collectLoadBindings has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private void collectLoadBindings(Object base, String prop, LinkedHashSet<LoadBinding> bindings,
            Set<TrackerNode> visited) {
        final LinkedHashSet<Object> kidbases = new LinkedHashSet<Object>(); //collect kid as base bean
        if (base != null) {
            final Set<TrackerNode> nodes = getAllTrackerNodesByBean(base);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
        final String cmd = request.getCommand();
        if (cmd.equals(Events.ON_SELECT)) {
            // ZK-2148: should check if model exists
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Selectbox.java - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
Open

    public Object clone() {
        final Grid clone = (Grid) super.clone();
        clone.init();

        // remove cached listeners
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.java - About 1 hr 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 selectItem has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public void selectItem(Treeitem item) {
        if (item == null) {
            clearSelection();
        } else {
            if (item.getTree() != this)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
Open

    private void renderChangedItem(Treeitem item, Object node) {
        /*
         * After modified the node in tree model, if node is leaf,
         * its treechildren is needed to be dropped.
         */
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 1 hr 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 onTreechildrenRemoved has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ void onTreechildrenRemoved(Treechildren tchs) {
        if (tchs == null || tchs.getParent() == this)
            return; //already being processed by onChildRemoved

        //main the selected status
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 1 hr 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 fixModeOnly has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private void fixModeOnly() { //called by afterCompose
        if ("auto".equals(_mode)) {
            if (_src != null && !_progressing && !_localized) {
                // according to the spec if query string exists, it should be defer
                // mode automatically.
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Include.java - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
Open

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

        if (!"normal".equals(_border))
            render(renderer, "border", _border);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/LayoutRegion.java - About 1 hr 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 removeRange has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

        protected void removeRange(int fromIndex, int toIndex) {
            if (fromIndex == toIndex - 1) {
                // single one
                super.removeRange(fromIndex, toIndex);
            } else {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/DefaultTreeNode.java - About 1 hr 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 show has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static Button show(String message, String title, Button[] buttons, String[] btnLabels, String icon,
            Button focus, EventListener<ClickEvent> listener, Map<String, String> params) {
        final Map<String, Object> arg = new HashMap<String, Object>();
        final Desktop desktop = Executions.getCurrent().getDesktop();
        arg.put("message", message);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Messagebox.java - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException {
        super.renderProperties(renderer);
        if (!"horizontal".equals(_orient))
            renderer.render("orient", _orient);
        if (!"{0}".equals(_slidingtext))
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Slider.java - About 1 hr 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 addVisibleItemCount has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    /* package */void addVisibleItemCount(int count) {
        if (count != 0) {
            _visibleItemCount += count;
            if (inPagingMold()) {
                final Paginal pgi = getPaginal();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr 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 encodeURL has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

        public String encodeURL(ServletRequest request, ServletResponse response, String uri)
                throws ServletException, UnsupportedEncodingException {
            uri = Servlets.locate(_ctx, request, uri, getLocator()); //resolves "*"
            uri = (_encURLPrefix != null ? _mappingURI + _encURLPrefix : _mappingURI) + uri; //prefix with mapping

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

    public static String normalizePath(String path) {
        if (path == null) {
            return null;
        }
        if ("/".equals(path)) {
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.java - About 1 hr 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