Showing 4,841 of 7,782 total issues

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

    public static final Method
    getMethodInPublic(Class<?> cls, String name, Class<?>[] argTypes)
    throws NoSuchMethodException {
        final Method m = cls.getMethod(name, argTypes);
        if (Modifier.isPublic(m.getDeclaringClass().getModifiers()))
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.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 getTopmostInterface has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static Class<?> getTopmostInterface(Class<?> cls, Class<?> subIF) {
        if (cls.isInterface())
            return subIF.isAssignableFrom(cls) ? cls: null;

        while (cls != null) {
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.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 escape has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String escape(String src, String specials) {
        if (src == null) return null; // Return null if src is null
        final char[] chars = src.toCharArray(); // Convert source string to char array
        StringBuilder sb = new StringBuilder(src.length()); // Use StringBuilder for efficiency

Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Strings.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 hasNext has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        public boolean hasNext() {
            if (this.next != null)
                return true;
            if (this.itr != null){
                while (this.next == null && itr.hasNext()) {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/CompositeELResolver.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 clone has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static final Object clone(Object o) {
        if (o == null)
            return o;

        try {
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Objects.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 paramString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private static final String paramString(Class<?>[] types) {
        if (types != null) {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < types.length; i++) {
                if (types[i] == null) {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.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 compare has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private Optional compare(boolean isMax, LambdaExpression le) {
        Object result = null;

        if (iterator.hasNext()) {
            Object obj = iterator.next();
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/stream/Stream.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 setImage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public void setImage(String image) {
        if (image.indexOf('\\') == -1) {
            this.image = image;
            return;
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstString.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 paramString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private static final String paramString(Class<?>[] types) {
        if (types != null) {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < types.length; i++) {
                if (types[i] == null) {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/Util.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 coerce has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected final Number coerce(final Object obj) {

        if (isNumber(obj)) {
            return coerce((Number) obj);
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELArithmetic.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 setValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public void setValue(ELContext context, Object base, Object property,
            Object value) {

        if (context == null) {
            throw new NullPointerException();
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/BeanNameELResolver.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 getConstructor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    static Constructor<?> getConstructor(Class<?> type, Constructor<?> c) {
        if (c == null || Modifier.isPublic(type.getModifiers())) {
            return c;
        }
        Constructor<?> cp = null;
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/Util.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 findDelegate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private static ELArithmetic findDelegate(final Object obj0, final Object obj1) {
        if (obj0 == null && obj1 == null) {
            return null;
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELArithmetic.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 search has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public List<Car> search(String keyword){
        List<Car> result = new LinkedList<Car>();
        if (keyword==null || "".equals(keyword)){
            result = carList;
        }else{

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

    public Validator getValidator1(){
        return new AbstractValidator() {
            
            
            public void validate(ValidationContext ctx) {

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

        public boolean accept(File dir, String name) {
            if(str.equals("")) return false;
            for(int i=0;i<skipList.length;i++){
                if(name.equals(skipList[i])) return false;
            }
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/MainWindow.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 dfSearchParent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private DefaultTreeNode<B70_ZK_2460_Contact> dfSearchParent(DefaultTreeNode<B70_ZK_2460_Contact> node, DefaultTreeNode<B70_ZK_2460_Contact> target) {
        if (node.getChildren() != null && node.getChildren().contains(target)) {
            return node;
        } else {
            int size = getChildCount(node);

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

    public static final String outResponseJavaScripts(Execution exec, boolean directJS) {
        final ExecutionCtrl execCtrl = (ExecutionCtrl) exec;
        final Collection<AuResponse> responses = execCtrl.getResponses();
        if (responses == null || responses.isEmpty())
            return "";
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.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 isGroupingAllowed has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private static final boolean isGroupingAllowed(Desktop desktop) {
        final String name = "org.zkoss.zk.ui.input.grouping.allowed";
        if (desktop != null) {
            final Collection<Page> pages = desktop.getPages();
            if (!pages.isEmpty()) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.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 checkUuid has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static void checkUuid(String uuid) {
        int j;
        if (uuid == null || (j = uuid.length()) == 0)
            throw new UiException("uuid cannot be null or empty");

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/ComponentsCtrl.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