Showing 4,841 of 7,782 total issues

Method seekNext has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private Component seekNext() {
        if (_index < 0) {
            _currCtx = buildRootCtx();
        } else {
            if (_lookingForShadow) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.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 getTokenType has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

            private Type getTokenType(char input, CharClass inputClass) {

                switch (inputClass) {
                case LITERAL:
                    return Type.IDENTIFIER;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/Tokenizer.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ static void handleError(ServletContext ctx, HttpServletRequest request, HttpServletResponse response,
            String path, Throwable err) throws ServletException, IOException {
        if (Servlets.isIncluded(request)) {
            final String msg = err != null
                    ? Messages.get(MZk.PAGE_FAILED,
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/Utils.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 evalImpl has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private Object evalImpl(Page page, Component parent) {
        return _impl == null ? null
                : parent != null ? _impl.getValue(getEvaluator(), parent)
                        : page != null ? _impl.getValue(getEvaluator(), page)
                                : _impl.isExpression() ? null : _impl.getRawValue();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ComponentInfo.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 init has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("deprecation")
    public void init() throws ServletException {
        final ServletConfig config = getServletConfig();
        String param = config.getInitParameter("log-level");
        if (param != null && param.length() > 0) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutServlet.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 readObject has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
        s.defaultReadObject();

        final Object v = s.readObject();
        if (v instanceof String) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ComponentInfo.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 getAnnotatedPropertiesBy has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public List<String> getAnnotatedPropertiesBy(String annotName) {
        if (_annots != null) {
            final List<String> list = new LinkedList<String>();
            for (Map.Entry<String, Map<String, List<Annotation>>> me : _annots.entrySet()) {
                final String propName = me.getKey();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AnnotationMap.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 setForEach has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void setForEach(String expr, String begin, String end, String step) {
        _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 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 initClone has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected void initClone(AbstractComponent cloneHost) {
        if (_previousInsertion != null) {
            if (_previousInsertion instanceof ShadowElement) {
                _previousInsertion = (Component) cloneHost.getShadowRoots().get(((ComponentCtrl) _host).getShadowRoots().indexOf(_previousInsertion));
            } else {
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 triggerAfterHostChildRemoved has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private void triggerAfterHostChildRemoved(Component child) {
        List<ShadowElement> shadowRoots = getShadowRoots();
        if (!shadowRoots.isEmpty()) {
            Map<Component, Integer> indexCacheMap = getIndexCacheMap(this);
            try {
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 addToShadowIdMap has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private static void addToShadowIdMap(Component comp) {
        if (comp instanceof ShadowElementCtrl) {
            Component host = ((ShadowElementCtrl) comp).getShadowHostIfAny();
            if (host != null) {
                String id = comp.getId();
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 onListenerChange has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private void onListenerChange(Desktop desktop, boolean listen) {
        if (listen) {
            if (Events.isListened(this, Events.ON_CLIENT_INFO, false)) { //asap+deferrable
                response(new AuClientInfo(desktop));
                getDesktop().setAttribute("org.zkoss.desktop.clientinfo.enabled", true);
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 loadClassAnnots has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private static void loadClassAnnots(AnnotationMap annots, Class<?> klass) {
        if (klass == null)
            return; //nothing to do

        //1. load class's
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/Impls.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 initClone has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        private void initClone(AbstractComponent owner, AuxInfo clone) {
            //spaceinfo (after children is cloned)
            if (spaceInfo != null) {
                clone.spaceInfo = owner.new SpaceInfo();
                owner.cloneSpaceInfoFrom(spaceInfo);
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 addClientEvent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected static void addClientEvent(Class<? extends Component> cls, String evtnm, int flags) {
        Map<String, Integer> events = _clientEvents.get(cls);

        if (events == null) {
            synchronized (cls.getClass()) {
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 addClassResolver has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean addClassResolver(ClassResolver resolver) {
        //Currently we support only SimpleClassResolver and ImportedClassResolver
        //but it is good enough
        if (resolver == null)
            return false;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.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 doMoved has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private Set<Component> doMoved(List<AuResponse> responses) {
        //Remove components that have to removed from the client
        final Set<Component> removed = new LinkedHashSet<Component>();
        for (Component comp : _moved) {
            final Page page = comp.getPage();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.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 doBeforeCompose has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ ComponentInfo doBeforeCompose(Page page, Component parent, ComponentInfo compInfo, boolean bRoot)
            throws Exception {
        if (_composerExts != null)
            for (Composer composer : _composerExts) {
                final boolean old = beforeInvoke(composer, bRoot);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/CreateInfo.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 readObject has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
        s.defaultReadObject();

        init();

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

    public void invokeExecutionCleanups(Execution exec, Execution parent, List<Throwable> errs) {
        if (_execCleans != null) {
            for (Iterator<ExecutionCleanup> it = new LinkedList<ExecutionCleanup>(_execCleans).iterator(); it
                    .hasNext();) {
                final ExecutionCleanup listener = it.next();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.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