Showing 7,765 of 7,765 total issues

Method isWpdContentRequired has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean isWpdContentRequired(String pkg, Element root) {
        for (LanguageDefinition langdef : LanguageDefinition.getByDeviceType(getDeviceType()))
            if (langdef.getJavaScriptPackagesWithMerges().contains(pkg)) return true;

        for (Iterator it = root.getElements("script").iterator(); it.hasNext();) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.java - About 25 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 guessImplicitObjectName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static String guessImplicitObjectName(Class<?> cls) {
        if (Execution.class.equals(cls))
            return "execution";
        if (Page.class.equals(cls))
            return "page";
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/Selectors.java - About 25 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 getLandingState has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

            protected State getLandingState(Character input, CharClass inputClass) {

                if (input == '[')
                    return State.IN_ATTRIBUTE;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/Tokenizer.java - About 25 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 alert has a Cognitive Complexity of 6 (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 25 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 addActivationListener has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static final void addActivationListener(ServletContext ctx, WebManagerActivationListener listener) {
        if (ctx == null || listener == null)
            throw new IllegalArgumentException("null");

        final WebManager webman = getWebManagerIfAny(ctx);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/WebManager.java - About 25 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 matchValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean matchValue(Object value, Attribute attr) {
        switch (attr.getOperator()) {
        case BEGIN_WITH:
            return value != null && value.toString().startsWith(attr.getValue());
        case END_WITH:

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

    private static TimeZone getTimeZone(HttpSession hsess) {
        TimeZone tz = checkTimeZone(hsess.getAttribute(Attributes.PREFERRED_TIME_ZONE));
        if (tz != null)
            return tz;

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

    public void addDataHandler(DataHandlerInfo info) {
        final String name = info.getName();
        DataHandlerInfo old = _dataHandlers.put(name, info);
        if (info.isOverride()) {
            if (old == null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 25 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 str has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static void str(StringBuilder sb, boolean[][] arr) {
        if (arr.length > 1)
            sb.append('[');
        for (int i = 0; i < arr.length; i++) {
            if (i > 0)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentMatchCtx.java - About 25 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 isDescendant has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean isDescendant(Component c1, Component c2) {
        if (c1 == c2)
            return true; // first c1 can be IdSpace
        while ((c1 = c1.getParent()) != null) {
            if (c1 == c2)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.java - About 25 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 getWidgetClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public String getWidgetClass(Component comp, String moldName) {
        if (_molds != null) {
            final ExValue wc = _molds.get(moldName);
            if (wc != null) {
                final String s = (String) wc.getValue(_evalr, comp);

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

        public static UiException wrap(Throwable t, int code, Object fmtArg) {
            t = Exceptions.unwrap(t);
            boolean skipWrapping = false;
            if (t instanceof Expectable)
                skipWrapping = true;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/UiException.java - About 25 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 fixFellows has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private final void fixFellows(Collection<Component> c) {
        for (Component comp : c) {
            final String compId = comp.getId();
            if (compId.length() > 0)
                addFellow(comp);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractPage.java - About 25 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 addAddon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static void addAddon(Locator locator, URL url) {
        if (locator == null || url == null)
            throw new IllegalArgumentException("null");

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

    public Collection<Annotation> getAnnotations(String propName) {
        if (_annots != null) {
            final Map<String, List<Annotation>> anmap = _annots.get(propName);
            if (anmap != null) {
                final List<Annotation> dst = new LinkedList<Annotation>();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AnnotationMap.java - About 25 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 getAnnotatedProperties has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public List<String> getAnnotatedProperties() {
        final List<String> list = new LinkedList<String>();
        if (_annots != null) {
            for (String propName : _annots.keySet()) {
                if (propName != null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AnnotationMap.java - About 25 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 readObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

        initFields();

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

    private void dupProps(ComponentInfo compInfo) {
        if (compInfo._annots != null)
            _annots = (AnnotationMap) compInfo._annots.clone();
        if (compInfo._props != null)
            _props = new LinkedList<Property>(compInfo._props);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ComponentInfo.java - About 25 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 addDeclaredNamespace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static void addDeclaredNamespace(NativeInfo nativeInfo, Collection<Namespace> namespaces,
            LanguageDefinition langdef) {
        for (Namespace ns : namespaces) {
            final String uri = ns.getURI();
            boolean bNatPrefix = uri.startsWith(LanguageDefinition.NATIVE_NAMESPACE_PREFIX);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 25 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 wrap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static UiException wrap(Throwable t, String msg) {
            t = Exceptions.unwrap(t);
            boolean skipWrapping = false;
            if (t instanceof Expectable)
                skipWrapping = true;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/UiException.java - About 25 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