Showing 7,775 of 7,775 total issues

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

    public void setValue(EvaluationContext ctx, Object value)
            throws ELException {
        VariableMapper varMapper = ctx.getVariableMapper();
        if (varMapper != null) {
            ValueExpression expr = varMapper.resolveVariable(this.image);
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstIdentifier.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 getType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Class<?> getType(EvaluationContext ctx) throws ELException {
        VariableMapper varMapper = ctx.getVariableMapper();
        if (varMapper != null) {
            ValueExpression expr = varMapper.resolveVariable(this.image);
            if (expr != null) {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstIdentifier.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 ValueSuffix has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  final public void ValueSuffix() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case DOT:
      DotSuffix();
      break;
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.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 getArrayDefaultTreeModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public static DefaultTreeModel getArrayDefaultTreeModel(int level1, int level2, int level3, String label) {
            Random rand = new Random(new Random().nextLong());
            Calendar cal = Calendar.getInstance();
            List list = new ArrayList(level1);
            for (int i = 0; i < level1; i++) {
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/util/ModelProvider.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 isStringFloat has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static final boolean isStringFloat(final String str) {
        int len = str.length();
        if (len > 1) {
            for (int i = 0; i < len; i++) {
                switch (str.charAt(i)) {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.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 compareTo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public int compareTo(MatchResult o) {
            int cmp = compare(this.getExact(), o.getExact());
            if (cmp == 0) {
                cmp = compare(this.getAssignable(), o.getAssignable());
                if (cmp == 0) {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/Util.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 mod has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

    public Object getValue(ELContext context, Object base, Object property) {

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

    public Person getElementAt(int index) {
        Map<Integer, Person> cache = getCache();

        Person targetPerson = cache.get(index);
        if (targetPerson == null) {

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

        public static DefaultTreeModel getBeanDefaultTreeModel(int level1, int level2, int level3, String label) {
            Random rand = new Random(new Random().nextLong());
            Calendar cal = Calendar.getInstance();
            List list = new ArrayList(level1);
            for (int i = 0; i < level1; i++) {
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/util/ModelProvider.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 createMethodExpression has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public MethodExpression createMethodExpression(Class<?> expectedReturnType,
            Class<?>[] expectedParamTypes) throws ELException {
        Node n = this.build();
        if (!n.isParametersProvided() && expectedParamTypes == null) {
            throw new NullPointerException(MessageFactory
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ExpressionBuilder.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 message has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static String message(ELContext context, String name, Object... props) {
        Locale locale = null;
        if (context != null) {
            locale = context.getLocale();
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/Util.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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public void validate(ValidationContext ctx) {
//            Map properties = (Map)ctx.getProperty().getValue()
            Iterator<String> keyIt = ctx.getProperties().keySet().iterator();
            while (keyIt.hasNext()){
                String propertyName = keyIt.next();
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/form/F2.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public void run() {
            try {
                while (true) {
                    if (_info.getDesktop() == null
                            || !_desktop.isServerPushEnabled()) {
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/CometServerPush.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 updateRandomNodes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @Listen("onClick = #updateButtonRandom")
    public void updateRandomNodes() {
        Random random = new Random();
        for(int i = 0; i < 10; i++) {
            TreeNode<String> randomNode = null;
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.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 getValidator1 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Validator getValidator1(){
        return new Validator(){
            public void validate(ValidationContext ctx) {
                if(!ctx.isValid()) return;
                Property p = ctx.getProperty();
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/bind/issue/B0004.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 getFormValidator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Validator getFormValidator(){
        return new AbstractValidator() {
            
            public void validate(ValidationContext ctx) {
                String val = (String)ctx.getProperties("value1")[0].getValue();
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/bind/issue/F00771.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 init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @Init
    public void init() {
        for (int i = 0; i < 8; i++) {
            headers.add("Header " + i);
            for (int j = 0; j < 2; j++) {
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/F85_ZK_3808VM.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 getValidator3 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Validator getValidator3(){
        return new Validator(){
            public void validate(ValidationContext ctx) {
                if(!ctx.isValid()) return;
                Object val1 = ctx.getProperties().get("value1")[0].getValue();//ctx.getPropertyValue("value1");
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/bind/issue/B0004.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 getItems has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static Object[][] getItems () {
        Object[][] items = new Object[itemCnt][3];
        int setCnt = -1;
        String setStr = "";
        for (int i = 0; i < itemCnt; i++) {

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