Showing 7,775 of 7,775 total issues

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

    public static Event getEvent(AuRequest request) {
        final String name = request.getCommand();
        final Component comp = request.getComponent();
        final Map<String, Object> data = request.getData();
        //ZK-1847 should check whether data is empty or not
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/Event.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 resolveInsertComponents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void resolveInsertComponents(Collection<Component> comps, Map<String, Component> map) {
        for (Component comp : comps) {
            final Annotation annt = ((ComponentCtrl) comp).getAnnotation(null, "insert");
            if (annt != null) {
                final String insertName = annt.getAttribute("value");
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Composition.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 getRichletByPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Richlet getRichletByPath(String path) {
        if (path == null || path.length() == 0 || "/".equals(path))
            path = "";
        else if (path.charAt(0) != '/')
            path = '/' + path;
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 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 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 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 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 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 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 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 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 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 addAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void addAll(EventHandlerMap src) {
        if (src != null && !src.isEmpty()) {
            for (Map.Entry<String, List<EventHandler>> me : src._evthds.entrySet()) {
                final String evtnm = me.getKey();
                for (EventHandler eh : me.getValue())
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/EventHandlerMap.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 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 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

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

Severity
Category
Status
Source
Language