zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.java

Summary

Maintainability
D
2 days
Test Coverage

Method assign0 has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
Open

    private void assign0(Component comp) throws Exception {
        if (comp instanceof ComponentCtrl) {
            ComponentCtrl ctrl = ((ComponentCtrl) comp);
            PropertyAccess propertyAccess = ctrl.getPropertyAccess(_name);
            if (propertyAccess != null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.java - About 1 day 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 assign0 has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void assign0(Component comp) throws Exception {
        if (comp instanceof ComponentCtrl) {
            ComponentCtrl ctrl = ((ComponentCtrl) comp);
            PropertyAccess propertyAccess = ctrl.getPropertyAccess(_name);
            if (propertyAccess != null) {
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.java - About 3 hrs to fix

    File Property.java has 285 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* Property.java
    
        Purpose:
            
        Description:
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.java - About 2 hrs to fix

      Method findAssignable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private static Method findAssignable(final Method[] mtds, final Object val) {
              if (val != null) {
                  //Look for the most 'extended' and isInstance class
                  Method m = null;
                  Class<?> t = null;
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.java - About 45 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 findNullable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private static Method findNullable(final Method[] mtds, final Object val) {
              if (val == null) {
                  //Look for the most 'extended' class
                  Method m = null;
                  Class<?> t = null;
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.java - About 45 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 resolve has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private Object[] resolve(Class cls) {
              Method mtd = null;
              Method[] mtds = null;
              final String mtdnm = Classes.toMethodName(_name, "set");
              if (_value == null) {
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.java - About 45 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(Component comp) {
              if (_value != null)
                  return _value.getValue(_evalr, comp);
      
              Desktop desktop = comp.getDesktop();
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.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 resolveMethod0 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private static final Method resolveMethod0(Class cls, String mtdnm) throws PropertyNotFoundException {
              try {
                  return Classes.getCloseMethod(cls, mtdnm, new Class[] { String.class });
              } catch (NoSuchMethodException ex) {
                  try {
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.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 findExact has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private static Method findExact(final Method[] mtds, final Object val) {
              if (val != null) {
                  final Class vcls = val.getClass();
                  for (int j = 0; j < mtds.length; ++j)
                      if (vcls.equals(mtds[j].getParameterTypes()[0]))
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.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

      There are no issues that match your filters.

      Category
      Status