Showing 7,775 of 7,775 total issues

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

    public static Class<?> getClass(Type type) {
        if (type instanceof Class<?>)
            return (Class<?>) type;

        else if (type instanceof ParameterizedType)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/Reflections.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 findResourcePath has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private String findResourcePath(RequestContext reqctx, OutputStream out, String path, String dir, boolean locate, boolean write) throws ServletException, IOException {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.java - About 45 mins to fix

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

            private Object parse(RequestContext reqctx) throws ServletException, IOException {
                if (_cnt instanceof SourceInfo)
                    try {
                        _cnt = ((SourceInfo) _cnt).parse(reqctx);
                    } catch (IOException ex) {
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.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 (rt2.getPreviousSibling() != rt)
                                return null;
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.java - About 45 mins to fix

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

          public static final void addExtension(String ext, String lang) {
              if (_loaded) {
                  LanguageDefinition.addExtension(ext, lang);
              } else {
                  if (lang == null || ext == null)
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.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) {

        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 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 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

          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

            Avoid deeply nested control flow statements.
            Open

                                    if (n != null && !withEL(n)) {
                                        int k = n.lastIndexOf('.');
                                        cssURI = "~." + device.toAbsolutePath(n.substring(0, k).replace('.', '/') + '/' + cssURI);
                                    } else {
                                        if (n == null) {
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.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

                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

                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 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 (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 (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

                        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 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 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

                        Severity
                        Category
                        Status
                        Source
                        Language