Showing 4,841 of 7,782 total issues

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

    static Object[] buildParameters(Class<?>[] parameterTypes,
            boolean isVarArgs,Object[] params) {
        ExpressionFactory factory = getExpressionFactory();
        Object[] parameters = null;
        if (parameterTypes.length > 0) {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/Util.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 coerceToNumber has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static final Number coerceToNumber(final Object obj,
            final Class<?> type) throws ELException {

        if (!COERCE_TO_ZERO) {
            if (obj == null && !type.isPrimitive()) {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.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

        public Object coerceToUi(Object val, Listbox comp, BindContext ctx) {
            Object bean = super.coerceToUi(val, comp, ctx);

            if (bean instanceof ListModelList && comp instanceof Listbox) {
                Listbox listbox = (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 onEvent has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public void onEvent(Event evt) throws Exception {
        final Object controller = getController();
        final Method mtd = ComponentsCtrl.getEventMethod(controller.getClass(), evt.getName());
        if (mtd != null) {
            if (mtd.getParameterTypes().length == 0)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/GenericEventListener.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 getRichlet has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public Richlet getRichlet(String name) {
        WaitLock lock = null;
        final Object[] info;
        for (;;) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.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 setAttribute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public Object setAttribute(String name, Object value) {
        final Object old = getAttribute(name);
        if (!(this instanceof Serializable || this instanceof Externalizable)) {
            final boolean bStore = value instanceof Serializable || value instanceof Externalizable;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/SimpleSession.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 handleError has a Cognitive Complexity of 13 (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/ZumlExtendlet.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 (_auxinf != null) {
            render(renderer, "width", _auxinf.width);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.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 parseInitDirective has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private void parseInitDirective(PageDefinition pgdef, ProcessingInstruction pi, Map<String, String> params)
            throws Exception {
        final String clsnm = params.remove("class");
        final String zsrc = params.remove("zscript");

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.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 adjustCursor has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

        public void adjustCursor(Integer result) {
            final int queryResult = result.intValue();
            if (queryResult < 0) { // not found, find next
                if (_mid <= _low) {
                    _low = _midChild + 1; // not found and do it from right again.
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.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 toAbsoluteURI has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private String toAbsoluteURI(String uri) {
        if (uri != null && uri.length() > 0) {
            final char cc = uri.charAt(0);
            if (cc != '/' && cc != '~' && !Servlets.isUniversalURL(uri)) {
                final String dir = getLocator().getDirectory();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.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 updateByClient has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected void updateByClient(String name, Object value) {
        Object o = getAttribute("org.zkoss.zk.ui.updateByClient");
        if (!(o instanceof Boolean && ((Boolean) o).booleanValue()) && !(o instanceof String && "true".equals(o))) {
            log.warn("Ignore update of " + name + "=" + value + " from client for " + this.getClass());
            return; //ignored
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 removeEventInterceptor has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean removeEventInterceptor(Class klass) {
        if (klass != null && _eis != null) {
            final List<EventInterceptor> eilst = new LinkedList<EventInterceptor>();
            final EventInterceptor[] eis = _eis;
            boolean found = false;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/EventInterceptors.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 removeEventInterceptor has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean removeEventInterceptor(EventInterceptor ei) {
        if (ei != null && _eis != null) {
            final List<EventInterceptor> eilst = new LinkedList<EventInterceptor>();
            final EventInterceptor[] eis = _eis;
            boolean found = false;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/EventInterceptors.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 deactivate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean deactivate(boolean stop) {
        boolean stopped = false;
        if (_active != null && Thread.currentThread().equals(_active.thread)) {
            if (--_active.nActive <= 0) {
                if (stop)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PollingServerPush.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 getStubInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private static final boolean[] getStubInfo(Component comp, Map<Component, boolean[]> stubinfs) {
        boolean[] stubinf = stubinfs.get(comp);
        if (stubinf == null) {
            Boolean stubnative = null, stubonly = null;
            for (Component c = comp; c != null;) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineExtension.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 add has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

            @SuppressWarnings("unchecked")
            public boolean add(Object o) {
                if (_set.add(o)) {
                    if (_listeners != null) {
                        if (_entry) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/SimpleScope.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 getDeviceByClient has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static final Device getDeviceByClient(String userAgent) throws DeviceNotFoundException {
        String[] devTypes;
        synchronized (_devmap) {
            Collection<String> c = _devmap.keySet();
            devTypes = c.toArray(new String[c.size()]);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/device/Devices.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 invoke has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public Object invoke(Object self, Method method, Method proceed, Object[] args) throws Exception {
        try {
            final String mname = method.getName();
            Class<?> declaringClass = method.getDeclaringClass();
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/proxy/FormProxyHandler.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 getEncodedData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public List<Object> getEncodedData() {
        if (_data == null)
            return null;

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/out/AuSetAttributes.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