Showing 4,841 of 7,782 total issues

Method buildChildCtxWithShadowOrComponent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private ComponentMatchCtx buildChildCtxWithShadowOrComponent(Component comp, HtmlShadowElement htmlShadowElement, boolean isFirstShadow) {
        if (comp != null && htmlShadowElement != null) {
            try {
                switch (HtmlShadowElement.inRange(htmlShadowElement, comp)) {
                    case PREVIOUS:
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 newVariableResolvers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static List<VariableResolver> newVariableResolvers(Class<?> cls, Class<?> untilClass) {
        final List<VariableResolver> resolvers = new ArrayList<VariableResolver>();
        while (cls != null && cls != untilClass) {
            final org.zkoss.zk.ui.select.annotation.VariableResolver anno = cls
                    .getAnnotation(org.zkoss.zk.ui.select.annotation.VariableResolver.class);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/Selectors.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 11 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ String invoke(RequestContext reqctx, MethodInfo mi) {
        final Class[] argTypes = mi.method.getParameterTypes();
        final Object[] args = mi.arguments.clone(); // ZK-4312: leaking request/response into wpd cache
        if (reqctx != null) {
            for (int j = 0; j < args.length; ++j)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/AbstractExtendlet.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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public void add(String evtnm, EventHandler evthd) {
        if (evtnm == null || evthd == null)
            throw new IllegalArgumentException("null");

        if (_evthds == null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/EventHandlerMap.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 parse has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private WcsInfo parse(InputStream is, String path) throws Exception {
        final Element root = new SAXBuilder(true, false, true).build(is).getRootElement();
        final String lang = IDOMs.getRequiredAttributeValue(root, "language");
        if (lang.length() == 0)
            throw new UiException("The language attribute must be specified, " + root.getLocator() + ", " + path);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/WcsExtendlet.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 addSclass has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public void addSclass(String cssClass) {
        if (!Strings.isEmpty(cssClass)) {
            String sclass = getSclass();
            if (sclass == null) {
                setSclass(cssClass);
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 getContent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public String getContent(Page page, Component comp) {
        if (_cnt != null)
            return _cnt;

        final URL url;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ZScript.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 service has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public void service(AuRequest request, boolean everError) {
        final String cmd = request.getCommand();
        if (cmd.equals(Events.ON_CLICK) || cmd.equals(Events.ON_DOUBLE_CLICK) || cmd.equals(Events.ON_RIGHT_CLICK)
                || cmd.equals(Events.ON_MOUSE_OVER) || cmd.equals(Events.ON_MOUSE_OUT)) {
            Events.postEvent(MouseEvent.getMouseEvent(request));
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 get has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public EventHandler get(Component comp, String evtnm) {
        if (_evthds != null) {
            final List<EventHandler> ehl = _evthds.get(evtnm);
            if (ehl != null)
                for (EventHandler eh : ehl)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/EventHandlerMap.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 getPreviousInsertionComponentIfAny has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public Component getPreviousInsertionComponentIfAny() {
        if (_previousInsertion == null) {
            Component result = _firstInsertion == null ? null : _firstInsertion.getNextSibling();
            if (result == null && getParent() != null) // ask for its parent
                return asShadow(getParent()).getPreviousInsertionComponentIfAny();
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 getLanguageDefinition has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private static final LanguageDefinition getLanguageDefinition(NodeInfo node) {
        for (; node != null; node = node.getParent()) {
            if (node instanceof ComponentInfo) {
                LanguageDefinition langdef = ((ComponentInfo) node).getLanguageDefinition();
                if (langdef != null)
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 getNextInsertionComponentIfAny has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public Component getNextInsertionComponentIfAny() {
        if (_nextInsertion == null) {
            Component result = _lastInsertion == null ? null : _lastInsertion.getNextSibling();
            if (result == null && getParent() != null) { // ask for its parent
                return asShadow(getParent()).getNextInsertionComponentIfAny();
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 triggerBeforeHostParentChanged has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private void triggerBeforeHostParentChanged(Component parent) {
        if (isDisabledHostChanged()) return;
        List<ShadowElement> shadowRoots = getShadowRoots();
        if (!shadowRoots.isEmpty()) {
            Map<Component, Integer> indexCacheMap = getIndexCacheMap(this);
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 triggerBeforeHostChildRemoved has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

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

    public void setDeviceType(String deviceType) {
        //Note: we check _comps.isEmpty() only if device type differs, because
        //a desktop might have several richlet and each of them will call
        //this method once
        if (!_devType.equals(deviceType)) {
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 redrawChildren has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected void redrawChildren(Writer out) throws IOException {
        final Object xc = getExtraCtrl();
        if (xc instanceof Cropper) {
            final Set<? extends Component> crop = ((Cropper) xc).getAvailableAtClient();
            if (crop != null) {
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 triggerAfterHostChildAdded has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

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

        public void onEvent(Event event) throws Exception {
            final long max = System.currentTimeMillis() + getMaxSchedTime();
            if (log.isDebugEnabled()) {
                log.debug("Handling schedule server push, _schedInfos is empty: [{}]", !scheduledServerPush());
            }
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 resolveClass has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        public Class resolveClass(String name) throws XelException {
            if (_mappers != null) {
                for (Iterator it = CollectionsX.comodifiableIterator(_mappers); it.hasNext();) {
                    final FunctionMapper mapper = (FunctionMapper) it.next();
                    if (mapper instanceof FunctionMapperExt) {
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 getAttributes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static final void getAttributes(StringBuffer sb, Map<String, Object> props,
            Collection<Namespace> namespaces) {
        if (namespaces != null && !namespaces.isEmpty()) {
            for (Namespace ns : namespaces) {
                sb.append(" xmlns");
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/NativeHelpers.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