Showing 4,841 of 7,782 total issues

File CollectionsX.java has 333 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* CollectionsX.java

    Purpose:
    Description:
    History:
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/CollectionsX.java - About 4 hrs to fix

    File SimpleConstraint.java has 333 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* SimpleConstraint.java
    
        Purpose:
    
        Description:
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.java - About 4 hrs to fix

      File RenderHttpServletRequest.java has 332 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* RenderHttpServletRequest.java
      
          Purpose:
              
          Description:

        Method Equality has 99 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          final public void Equality() throws ParseException {
            Compare();
            label_9:
            while (true) {
              switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        Severity: Major
        Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 3 hrs to fix

          Method fillShadowElement has 99 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private JSONObject fillShadowElement(HtmlShadowElement se, AbstractComponent current, ListIterator<AbstractComponent> cit) {
                  String name = se.toString();
                  int index = name.lastIndexOf("->");
                  if (index > 0)
                      name = name.substring(index + 2);

            File AbstractWebApp.java has 331 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* AbstractWebApp.java
            
                Purpose:
            
                Description:
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java - About 3 hrs to fix

              Method coalesce has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  public final int coalesce(boolean recursive) {
                      int count = 0;
                      Item found = null;
                      StringBuilder sb = new StringBuilder();
                      for (final Iterator<Item> it = _children.iterator(); it.hasNext();) {
              Severity: Minor
              Found in zcommon/src/main/java/org/zkoss/idom/impl/AbstractGroup.java - About 3 hrs 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 createNodeInternal has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  private static final Node createNodeInternal(String expr)
                          throws ELException {
                      if (expr == null) {
                          throw new ELException(MessageFactory.get("error.null"));
                      }
              Severity: Minor
              Found in zel/src/main/java/org/zkoss/zel/impl/lang/ExpressionBuilder.java - About 3 hrs 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 coerceToCollection has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  @SuppressWarnings({ "rawtypes", "unchecked" })
                  private static Object coerceToCollection(Object obj, Class<?> type) {
                      if(obj==null) return null;
                      // since 8.0.0 support proxy form binding
                      if (ProxyFactory.isProxyClass(type)) {
              Severity: Minor
              Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java - About 3 hrs 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 loadProperites has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  private void loadProperites(ServletContext context) {
                      try {
                          BufferedReader bufReader = new BufferedReader(
                                  new InputStreamReader(context.getResourceAsStream(PATH + CONFIG)));
                          String prop = null;
              Severity: Minor
              Found in zksandbox/src/main/java/org/zkoss/zksandbox/DemoWebAppInit.java - About 3 hrs 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 getStyleSheets has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static final List<StyleSheet> getStyleSheets(Execution exec, WebApp wapp, String deviceType) {
                      if (wapp == null)
                          wapp = exec.getDesktop().getWebApp();
                      if (deviceType == null)
                          deviceType = exec.getDesktop().getDeviceType();
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.java - About 3 hrs 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 parseContent has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static final ZScript parseContent(String content, int lineno) {
                      String prefix = null, zslang = null;
                      final int len = content != null ? content.length() : 0;
                      if (len > 0) {
                          //Don't generate prefix if content is empty (i.e., keep empty)
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ZScript.java - About 3 hrs 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 service has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void service(AuRequest request, boolean everError) {
                      if (_ausvcs != null) {
                          //Note: removeListener might be called when invoking svc.service()
                          for (Iterator<AuService> it = new LinkedList<AuService>(_ausvcs).iterator(); it.hasNext();)
                              if (it.next().service(request, everError))
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 3 hrs 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 process has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void process(Session sess, HttpServletRequest request, HttpServletResponse response, boolean compress)
                          throws ServletException, IOException {
                      final String errClient = request.getHeader("ZK-Error-Report");
                      if (errClient != null)
                          if (log.isDebugEnabled())
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.java - About 3 hrs 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 service has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void service(HttpServletRequest request, HttpServletResponse response, String pi)
                          throws ServletException, IOException {
                      //        if (log.isDebugEnabled()) log.debug("View "+pi);
                      final Session sess = Sessions.getCurrent(false);
                      if (sess == null) {
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/au/http/AuDynaMediar.java - About 3 hrs 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 load has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  @SuppressWarnings("unchecked")
                  public void load(BindContext ctx) {
                      final Component comp = getComponent(); //ctx.getComponent();
                      final BindEvaluatorX eval = getBinder().getEvaluatorX();
                      final BindingExecutionInfoCollector collector = ((BinderCtrl) getBinder()).getBindingExecutionInfoCollector();
              Severity: Minor
              Found in zkbind/src/main/java/org/zkoss/bind/impl/LoadChildrenBindingImpl.java - About 3 hrs 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 render has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  @SuppressWarnings("unchecked")
                  public void render(final Component owner, final Object data, final int index, final int size,
                          final boolean isListModel) {
                      final Template tm = resolveTemplate(owner, owner, data, index, size, "children");
                      if (tm == null) {
              Severity: Minor
              Found in zkbind/src/main/java/org/zkoss/bind/impl/BindChildRenderer.java - About 3 hrs 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 insertBefore has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  public boolean insertBefore(Component newChild, Component refChild) {
                      if (newChild instanceof Caption) {
                          refChild = getFirstChild();
                          //always makes caption as the first child
                          if (super.insertBefore(newChild, refChild)) {
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Panel.java - About 3 hrs 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 parseFieldNames has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  private Collection<FieldInfo> parseFieldNames(String fieldnames, boolean ascending) {
                      final Collection<String> fields = CollectionsX.parse(new ArrayList<String>(), fieldnames, ',');
                      final List<FieldInfo> results = new ArrayList<FieldInfo>(fields.size());
                      for (final Iterator<String> it = fields.iterator(); it.hasNext();) {
                          final String field = it.next().trim();
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/FieldComparator.java - About 3 hrs 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

              Function _finishDrag has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  _finishDrag(evt: zk.Event, success: boolean): void {
                      this.dragging = false;
                      if (this.stackup) {
                          jq(this.stackup).remove();
                          delete this.stackup;
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/drag.ts - About 3 hrs 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