Showing 4,841 of 7,782 total issues

Avoid deeply nested control flow statements.
Open

                        if (sb != null)
                            sb.append(cc);
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/NativeInfo.java - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (!bRichlet) {
                                path = prefs.getValue(ATTR_RICHLET, null);
                                bRichlet = path != null;
                                if (!bRichlet)
                                    path = _defpage;
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutPortlet.java - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (Interpreters.exists(zslang)) {
                                  content = content.substring(j + 1);
                                  break;
                              } else {
                                  log.warn("Ignored: unknown scripting language, " + zslang);
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ZScript.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (controller != null && comp.getAttribute((String) ctrlnm) == null) {
                                    comp.setAttribute((String) ctrlnm, controller);
                                }
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AttributesInfo.java - About 45 mins to fix

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

              private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
                  s.defaultWriteObject();
          
                  final LanguageDefinition langdef = _compdef.getLanguageDefinition();
                  if (langdef != null) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ComponentInfo.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 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 beforeService has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static Desktop beforeService(DesktopRecycle dtrc, ServletContext ctx, Session sess,
                      HttpServletRequest request, HttpServletResponse response, String path) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/http/DesktopRecycles.java - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                                if (j < len && val.charAt(j) == '(')
                                                    return true;
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/impl/AnnotationHelper.java - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (ai._loc == null)
                                          ai._loc = an.getLocation();
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AnnotationMap.java - About 45 mins to fix

                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 newMacroDefinition has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static final ComponentDefinition newMacroDefinition(LanguageDefinition langdef, PageDefinition pgdef,
                            String name, Class<? extends Component> cls, String macroURI, boolean inline) {

                  Method parseItem has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      private Object parseItem(PageDefinition pgdef, NodeInfo parent, Element el, AnnotationHelper annHelper,
                              boolean bNativeContent, ParsingState parsingState) throws Exception {
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 45 mins to fix

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

                        /*package*/ Object newInstance(Class<?> cls, Evaluator eval, Page page) throws Exception {
                            if (_args != null) {
                                Map<String, Object> args = resolveArguments(eval, page);
                                try {
                                    return cls.getConstructor(new Class[] { Map.class }).newInstance(new Object[] { args });
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ArgumentInfo.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

                    Avoid deeply nested control flow statements.
                    Open

                                            if (j > 0)
                                                sb.append(value.substring(0, j));
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/NativeInfo.java - About 45 mins to fix

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

                          public static final Locator getLocator(WebApp wapp, String path) {
                              if (wapp == null)
                                  throw new IllegalArgumentException("null");
                      
                              if (path != null && path.length() > 0 && path.charAt(0) == '/') {
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinitions.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 getValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public Object getValue(PageDefinition pgdef, Page page) {
                              final Evaluator eval = pgdef.getEvaluator();
                              if (_cond == null || _cond.isEffective(eval, page)) {
                                  final Object val = _value.getValue(eval, page);
                                  return val != null ? val instanceof Date ? val : val.toString() : "";
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ResponseHeaderInfo.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 parseAsProperty has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          private void parseAsProperty(PageDefinition pgdef, ComponentInfo compInfo, String name, Collection items,
                                  AnnotationHelper annHelper, ConditionImpl cond) throws Exception {
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                for (Annotation anno : annotationMap.getAnnotations(propName)) {
                                                    compInfo.addAnnotation(propName, anno.getName(), anno.getAttributes(), anno.getLocation());
                                                }
                        Severity: Major
                        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 45 mins to fix

                          Method applyAttrAnnot has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              private static void applyAttrAnnot(AnnotationHelper attrAnnHelper, ShadowInfo compInfo, String nm, String val,
                                      boolean selfAllowed, org.zkoss.util.resource.Location loc) {
                          Severity: Minor
                          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language