Showing 4,841 of 7,782 total issues

Method alert has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected void alert(String m) {
        if ("ajax".equals(Executions.getCurrent().getDesktop().getDeviceType())) {
            //zk.jar cannot depends on zul.jar; thus we call Messagebox.show() via
            //reflection.
            try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/GenericAutowireComposer.java - About 55 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 initializeProvider has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        private static EventQueueProvider initializeProvider() {
            EventQueueProvider provider = null;
            String clsnm = Library.getProperty(
                    "org.zkoss.zk.ui.event.EventQueueProvider.class");
            if (clsnm == null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/EventQueues.java - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    private static Integer parseInteger(Element el, String subnm, int flag) throws UiException {
        //Note: we throw exception rather than warning to make sure
        //the developer correct it
        String val = el.getElementValue(subnm, true);
        if (val != null && val.length() > 0) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.java - About 55 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 setDynamicProperty has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public void setDynamicProperty(String name, Object value) throws WrongValueException {
        if (name == null)
            throw new WrongValueException("name required");

        if (value == null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlNativeComponent.java - About 55 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 sendEvent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static void sendEvent(Component comp, Event event) {
        final Execution exec = Executions.getCurrent();
        final Desktop desktop = exec.getDesktop();
        //note: we don't use comp.getDesktop because 1) it may be null
        //2) it may be different from the current desktop
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/Events.java - About 55 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 dispatch has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean dispatch(Writer out, String page, Map params, int mode, boolean include)
            throws IOException, ServletException {
        //FUTURE: handle if ~./, PASS_THRU_ATTR and with query string
        //In other words, we convert query string to params if
        //PASS_THRU_ATTR and ~./ (to have a better performance)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/ExecutionImpl.java - About 55 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 setAttribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public Object setAttribute(String name, Object value, boolean recurse) {
        if (recurse && !hasAttribute(name)) {
            if (_wapp != null) {
                if (_wapp.hasAttribute(name, true))
                    return _wapp.setAttribute(name, value, true);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/SimpleSession.java - About 55 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 removeAttribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public Object removeAttribute(String name, boolean recurse) {
        if (recurse && !hasAttribute(name)) {
            if (_wapp != null) {
                if (_wapp.hasAttribute(name, true))
                    return _wapp.removeAttribute(name, true);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/SimpleSession.java - About 55 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 buildChildCtx has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private ComponentMatchCtx buildChildCtx(Component comp) {
        _trackedUuid.add(comp.getUuid());
        ComponentMatchCtx parent = _currCtx;
        boolean insideShadow = false;
        if (parent.getComponent() instanceof ShadowElement) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.java - About 55 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 init has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public void init(final Page page, final boolean evalHeaders) {
        final PageCtrl pageCtrl = (PageCtrl) page;
        pageCtrl.init(new PageConfig() {
            public String getId() {
                return _id;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 55 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 writeObject has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
        s.defaultWriteObject();

        if (_compdefs != null) {
            synchronized (_compdefs) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ComponentDefinitionMap.java - About 55 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 resolveForEach has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public ForEach resolveForEach(Page page, Component comp) {
        return _forEach == null ? null
                : _forEachInfo.length == 2
                        ? (comp != null
                                ? ForEachImpl.getInstance(_evalr, comp, _forEach, _forEachInfo[0], _forEachInfo[1])
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ForEachBranchInfo.java - About 55 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 newInstance has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public Component newInstance(Page page, Component parent) {
        Object impl = evalImpl(page, parent);
        ComponentsCtrl.setCurrentInfo(this);
        final Component comp;
        try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ComponentInfo.java - About 55 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 parseAttribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private void parseAttribute(PageDefinition pgdef, ComponentInfo parent, Element el, AnnotationHelper annHelper)
            throws Exception {
        if (el.getAttributeItem("forEach") != null)
            throw new UiException(message("forEach not applicable to attribute", el));

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

    public static void parseUpload(Component comp, String upload) {
        if (!Strings.isEmpty(upload)) {
            Map<String, String> args = new HashMap<String, String>();
            Maps.parse(args, upload, ',', (char) 1);

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

            public Iterator<Component> iterator() {
                return new Iterator<Component>() {
                    final Iterator<Component> _it = children.iterator();
                    Component _next;

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

    private Object binarySearchSubTree(HtmlShadowElement subTree, int queryIndex, Map<Component, Integer> indexMap) {
        int startIndex, endIndex;
        if (subTree._firstInsertion == null) {
            return -1; // skip this;
        } else if ((startIndex = indexMap.get(subTree._firstInsertion)) > queryIndex) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 55 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 markARing has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        @SuppressWarnings("unchecked")
        private void markARing(Component child, boolean set, int which) {
            if (set) {
                if (_aring == null)
                    _aring = new Set[2];
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 55 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 triggerBeforeHostChildAdded has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private void triggerBeforeHostChildAdded(Component child, Component insertBefore) {
        if (isDisabledHostChanged()) return;
        List<ShadowElement> shadowRoots = getShadowRoots();
        if (!shadowRoots.isEmpty()) {
            try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 55 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 checkIdSpaces has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private static void checkIdSpaces(final AbstractComponent comp, String newId) {
        if (comp instanceof NonFellow)
            return; //no need to check

        if (comp instanceof IdSpace && comp._auxinf.spaceInfo.fellows.containsKey(newId))
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 55 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