Showing 4,841 of 7,782 total issues

Method addErrorPage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public String addErrorPage(String deviceType, Class<?> type, String location) {
        if (!Throwable.class.isAssignableFrom(type))
            throw new IllegalArgumentException("Throwable or derived is required: " + type);
        if (location == null || deviceType == null)
            throw new IllegalArgumentException();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 35 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 unsubscribe has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean unsubscribe(EventListener<T> listener) {
        if (listener == null)
            throw new IllegalArgumentException();

        final Execution exec = Executions.getCurrent();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/impl/ServerPushEventQueue.java - About 35 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 addRichlet0 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private Object addRichlet0(String name, Object richletClass, Map<String, String> params) {
        Object o;

        for (;;) {
            // remove previous richlet if it exists
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 35 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 wireImplicit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public void wireImplicit(Object x) {
        //Feature #3315689 
        if (ignoreFromWire(_controller.getClass()))
            return;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWire.java - About 35 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 getId has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static final String getId(Component comp, String uuid) {
        if (comp instanceof StubComponent)
            return ((StubComponent) comp).getId(uuid);
        if (comp != null) {
            String id = comp.getId();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/StubEvent.java - About 35 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 invokeEventThreadInits has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean invokeEventThreadInits(List<EventThreadInit> inits, Component comp, Event evt) throws UiException {
        if (inits == null || inits.isEmpty())
            return true; //not to ignore

        for (EventThreadInit fn : inits) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 35 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 getResourceAsStream has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private InputStream getResourceAsStream(HttpServletRequest request, String path, boolean locate)
            throws IOException, ServletException {
        if (locate)
            path = Servlets.locate(_webctx.getServletContext(), request, path, _webctx.getLocator());

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

    private static final Object setup(Object sess, ServletRequest request, ServletResponse response, String charset) {
        final Object[] old;
        if (request.getAttribute(ATTR_SETUP) != null) { //has been setup
            old = null;
        } else {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/I18Ns.java - About 35 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 parseInteger has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static Integer parseInteger(Element el, String subnm, boolean positiveOnly) throws UiException {
        //Warning instead of exception since config.xml is embedded in jar, so
        //better not to stop the process
        String val = el.getElementValue(subnm, true);
        if (val != null && val.length() > 0) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.java - About 35 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 addAttribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        private void addAttribute(String name, String[] value) {
            if (name == null || name.length() == 0)
                name = "value";
            if (value == null)
                value = new String[0];
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AnnotationMap.java - About 35 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 setForEach has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void setForEach(String expr, String begin, String end) {
        _forEach = Utils.parseList(expr, Object.class, false);
        //forEach="" means to iterate a single-element array and the value
        //is empty
        _forEachInfo = _forEach == null ? null
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ForEachBranchInfo.java - About 35 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 parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        protected PageDefinition parse(String path, File file, Object extra) throws Exception {
            final Locator locator = extra != null ? (Locator) extra : getLocator(_wapp, path);
            Parser parser = new Parser(_wapp, locator);
            // Bug ZK-1132
            if (file.exists()) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinitions.java - About 35 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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public ComponentDefinition get(Class cls) {
        if (_compdefsByClass != null) {
            for (; cls != null; cls = cls.getSuperclass()) {
                final ComponentDefinition compdef = _compdefsByClass.get(cls.getName());
                if (compdef != null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ComponentDefinitionMap.java - About 35 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 parseTextAs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static void parseTextAs(ComponentDefinitionImpl compdef, Element el) {
        if (el != null) {
            final String s = el.getText(true);
            noEmpty("text-as", s, el);
            noEL("text-as", s, el);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.java - About 35 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 clone has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Object clone() {
        final ComponentDefinitionImpl compdef;
        try {
            compdef = (ComponentDefinitionImpl) super.clone();
        } catch (CloneNotSupportedException ex) {

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

    public void setDefaultWidgetClass(String widgetClass) {
        final ExValue oldwc = _defWgtClass;
        _defWgtClass = new ExValue(widgetClass, String.class);

        //replace mold's widget class if it is the old default one

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

        public String toString() {
            final StringBuffer sb = new StringBuffer().append('@').append(_name).append('(');
            if (_attrs != null) {
                boolean first = true;
                for (Map.Entry<String, String[]> me : _attrs.entrySet()) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AnnotationMap.java - About 35 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 addHeaderInfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void addHeaderInfo(HeaderInfo header, boolean before) {
        if (header == null)
            throw new IllegalArgumentException();

        if (before) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 35 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 checkUpdateURI has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String checkUpdateURI(String updateURI, String info) throws ServletException {
        if (updateURI == null || (updateURI = updateURI.trim()).length() == 0 || updateURI.charAt(0) != '/')
            throw new ServletException(info + " must be specified and starts with /");
        if (updateURI.indexOf(';') >= 0 || updateURI.indexOf('?') >= 0)
            throw new ServletException(info + " cannot contain ';' or '?'");
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/Utils.java - About 35 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 addAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void addAll(AnnotationMap src) {
        if (src != null && !src.isEmpty()) {
            initAnnots();

            for (Map.Entry<String, Map<String, List<Annotation>>> me : src._annots.entrySet()) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AnnotationMap.java - About 35 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