Showing 7,775 of 7,775 total issues

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

    public static final String valueOf(Node node) {
        if (node instanceof Item) {
            String v = ((Item)node).getText();
            return v != null ? v: "";
        }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/xml/Nodes.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 setContent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public final Object setContent(String path, Object obj) {
        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 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 checkAdd has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        private void checkAdd(Attribute newItem, Attribute other, boolean replace) {
            //first, remove any existent with the same uri and name
            if (newItem.getOwner() != null)
                throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                    "Attribute, "+newItem.toString()+", owned by other; detach or clone it", getLocator());
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 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 set has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public static final void set(Object obj, String name, Object val,
    boolean autoCoerce) throws NoSuchMethodException {
        try {
            AccessibleObject acs;
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/reflect/Fields.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 toAttributeName has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String toAttributeName(String methodName) {
        int len = methodName.length();
        if (len < 2)
            return null;

Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.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 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 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 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 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 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 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 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

          Severity
          Category
          Status
          Source
          Language