Showing 4,841 of 7,782 total issues

Method getContent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public final Object getContent(String path) {
        Element e = this;
        int j = 0;
        while (true) {
            int k = path.indexOf('/', j);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Element.java - About 1 hr 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 getNamespace has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public final Namespace getNamespace(String prefix) {
        if (prefix == null)
            prefix = "";

        Namespace ns = Namespace.getSpecial(prefix);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Element.java - About 1 hr 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 addAll has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public void addAll(ImportedClassResolver resolver) {
        if (resolver._pkgs != null) {
            if (_pkgs == null)
                _pkgs = new LinkedList<String>();
            for (String pkg: resolver._pkgs) {
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/ImportedClassResolver.java - About 1 hr 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 setNestedState has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private void setNestedState(NestedState nestedState) {
        if (this.nestedState != null) {
            // Should never happen
            throw new IllegalStateException("nestedState may only be set once");
        }

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

    public Stream flatMap(final LambdaExpression le) {
        Iterator<Object> downStream = new OpIterator() {

            private Iterator<?> inner;
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/stream/Stream.java - About 1 hr 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 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

            @ContextParam(ContextType.EXECUTION) Execution execution,
            @ContextParam(ContextType.COMPONENT) Component component,
            @ContextParam(ContextType.VIEW) Component view,
            @ContextParam(ContextType.SPACE_OWNER) IdSpace spaceOwner, 
            @ContextParam(ContextType.PAGE) Page page,

    Method cmd1 has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public void cmd1(@ScopeParam("applicationScopeVar") String applicationScope,
                @ScopeParam("sessionScopeVar") String sessionScope,
                @ScopeParam("desktopScopeVar") String desktopScope,
                @ScopeParam(value="pageScopeVar") String pageScope,
                @ScopeParam(value="spaceScopeVar") String spaceScope,
    Severity: Major
    Found in zktest/src/main/java/org/zkoss/zktest/bind/basic/ScopeParamVM.java - About 1 hr to fix

      Method init has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public void init(@ScopeParam("applicationScopeVar") String applicationScope,
                  @ScopeParam("sessionScopeVar") String sessionScope,
                  @ScopeParam("desktopScopeVar") String desktopScope,
                  @ScopeParam("pageScopeVar") String pageScope,
                  @ScopeParam("spaceScopeVar") String spaceScope,
      Severity: Major
      Found in zktest/src/main/java/org/zkoss/zktest/bind/basic/ScopeParamVM.java - About 1 hr to fix

        Method cmd1 has 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                    @ContextParam(ContextType.EXECUTION) Execution execution,
                    @ContextParam(ContextType.COMPONENT) Component component,
                    @ContextParam(ContextType.SPACE_OWNER) IdSpace spaceOwner, 
                    @ContextParam(ContextType.PAGE) Page page,
                    @ContextParam(ContextType.DESKTOP) Desktop desktop,

          Method addTreeNode has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              private BugOasiTreeNode<BugFormModel> addTreeNode(
                      BugOasiTreeNode<BugFormModel> parent,
                      BugOasiTreeNode<BugFormModel> newnod, BugFormModel myrow, boolean open,
                      Integer pos) {
                  if (parent == 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 accept has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

                  public boolean accept(File dir, String name) {
                      for (int i = 0; i < SKIP_LIST.length; i++)
                          if (name.equals(SKIP_LIST[i]))
                              return false;
                      final String n = name; 
          Severity: Minor
          Found in zktest/src/main/java/org/zkoss/zktest/test2/MainLayout.java - About 1 hr 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 initKey has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              private void initKey() {
                  // We have to decide the key of Google Maps since we have a demo using
                  // it.
                  // This key is used by zksandbox/index.zul to generate a proper
                  // script
          Severity: Minor
          Found in zksandbox/src/main/java/org/zkoss/zksandbox/MainLayoutComposer.java - About 1 hr 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 outDivTemplateEnd has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              private static void outDivTemplateEnd(Page page, Writer out) throws IOException {
                  final Desktop dt;
                  if (page != null && (dt = page.getDesktop()) != null) {
                      if (dt.getAttribute(ATTR_DESKTOP_CLIENTINFO) != null) {
                          dt.removeAttribute(ATTR_DESKTOP_CLIENTINFO);
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.java - About 1 hr 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 onMainCreate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public void onMainCreate(Event event) {
                  final Execution exec = Executions.getCurrent();
                  final String id = exec.getParameter("id");
                  Listitem item = null;
                  if (id != null) {
          Severity: Minor
          Found in zksandbox/src/main/java/org/zkoss/zksandbox/MainLayoutComposer.java - About 1 hr 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 checkVersion has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public static boolean checkVersion(URL url, Document doc, boolean zk5required) throws Exception {
                  final Element el = doc.getRootElement().getElement("version");
                  if (el == null)
                      return true; //version is optional (3.0.5)
          
          
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.java - About 1 hr 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 parseList has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public static ExValue[] parseList(String expr, Class expcls, boolean ignoreEmpty) {
                  if (expr == null)
                      return null;
          
                  if (expr.length() != 0) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/xel/impl/Utils.java - About 1 hr 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 renderWidgetOverrides has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public void renderWidgetOverrides(Map<String, String> overrides) {
                  if (overrides == null || overrides.isEmpty())
                      return;
          
                  renderName("overrides");
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
          Open

                  public void run() {
                      try {
                          _inf.listener.onEvent(_event);
          
                          if (_inf.callback != null || _pendingEvents != null) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/event/impl/DesktopEventQueue.java - About 1 hr 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 invokeEventThreadCompletes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public void invokeEventThreadCompletes(List<EventThreadCleanup> cleanups, Component comp, Event evt,
                      List<Throwable> errs, boolean silent) {
                  if (cleanups == null || cleanups.isEmpty())
                      return;
          
          
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr 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 newEventThreadCleanups has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public List<EventThreadCleanup> newEventThreadCleanups(Component comp, Event evt, List<Throwable> errs,
                      boolean silent) {
                  final Class<?>[] ary = _evtCleans.toArray();
                  if (ary.length == 0)
                      return null;
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr 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