Showing 4,841 of 7,782 total issues

Method doActivate has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    private static UiVisualizer doActivate(Execution exec, boolean asyncupd, boolean recovering,
            Object[] resultOfRepeat, int timeout) {
        if (Executions.getCurrent() != null)
            throw new IllegalStateException("Use doReactivate instead");
        //        assert !recovering || !asyncupd; //Not support both asyncupd and recovering are true yet
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 5 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 getValue has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    public Object getValue(ELContext ctx, Object base, Object property) throws PropertyNotFoundException, ELException {
        Object value = null;
        if (base == null) {
            if (_pathResolver == null) {
                _pathResolver = new PathELResolver(); // init
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 5 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 containsValue has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean containsValue(Object value) {
        Entry[] tab = this.table;

        if (value == null) {
            for (int i = tab.length; i-- > 0;) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java - About 5 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 doPropertyChange0 has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    private void doPropertyChange0(Object base, String prop, Set<LoadBinding> bindings) {
        Execution exec = Executions.getCurrent();
        Set<Component> skipCheckChildren = (Set<Component>) exec.getAttribute(HtmlShadowElement.SKIP_DISTRIBUTED_CHILDREN_PROPERTY_CHANGE);
        for (LoadBinding binding : bindings) {
            //BUG 828, the sub-sequence binding might be removed after the previous loading.
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 5 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 getAvailableAtClient has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    protected Set<? extends Component> getAvailableAtClient(int offset, int limit, boolean itemOnly) {
        final Set<Component> avail = new LinkedHashSet<Component>(32);
        if (!itemOnly) {
            avail.addAll(_listbox.getHeads());
            final Listfoot listfoot = _listbox.getListfoot();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java - About 5 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 _scrollIntoView has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    _scrollIntoView(parent?: Element | boolean): this {
        // eslint-disable-next-line zk/noNull
        var n: HTMLElement | null = this.jq[0];
        if (n) {
            var real = jq('#' + n.id + '-real')[0];
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - About 5 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 _doCmds has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

        export function _doCmds(sid?: string): void { //called by mount.js, too
            for (var fn: (() => void) | undefined; fn = doCmdFns.shift();)
                fn();

            var ex: Error | undefined, j = 0, rid = responseId;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - About 5 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 _create0 has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

function _create0(parent: zk.Widget, e: HTMLElement, args: unknown, cwgts: zk.Widget[]): void {
    var ifc = _eval(parent, e.getAttribute('if'), args),
        unless = _eval(parent, e.getAttribute('unless'), args);
    if ((ifc == null || ifc) && (unless == null || !unless)) {
        var tn = e.tagName, wgt: zk.Widget;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/zuml/Parser.ts - About 5 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 position has 134 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    position(dim?: Dimension | Element, where?: string, opts?: PositionOptions): this {
        where = where || 'overlap';

        if (!dim) {
            var bd = jq('body')[0];
Severity: Major
Found in zk/src/main/resources/web/js/zk/dom.ts - About 5 hrs to fix

    ResourceHttpServletResponse has 40 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class ResourceHttpServletResponse implements HttpServletResponse {
        private final ResourceResponse _res;
    
        public static HttpServletResponse getInstance(ResourceResponse res) {
            if (res instanceof HttpServletResponse)

      RenderHttpServletResponse has 40 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class RenderHttpServletResponse implements HttpServletResponse {
          private final RenderResponse _res;
      
          public static HttpServletResponse getInstance(RenderResponse res) {
              if (res instanceof HttpServletResponse)

        Method resolveVariable0 has 132 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected Object resolveVariable0(Object self, XelContext ctx, Object base, Object onm) {
                if (base != null) {
                    Object o = ((ExecutionCtrl) _exec).getExtraXelVariable(ctx, base, onm);
                    if (o != null)
                        return o;
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/xel/impl/ExecutionResolver.java - About 5 hrs to fix

          Method myLocate has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              private static final Object
              myLocate(String file, Locale locale, Locator locator, boolean asStream) {
                  if (locale == null)
                      locale = Locales.getCurrent();
          
          
          Severity: Minor
          Found in zcommon/src/main/java/org/zkoss/util/resource/Locators.java - About 5 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 getDateJavaScript has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              private static final String getDateJavaScript(Locale locale, int firstDayOfWeek) {
                  final StringBuffer sb = new StringBuffer(512);
                  final Calendar cal = Calendar.getInstance(locale);
                  final int twoDigitYearStart = Utils.get2DigitYearStart();
                  cal.clear();
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/http/Wpds.java - About 5 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 beforeHostChildAdded has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public void beforeHostChildAdded(Component child, Component insertBefore, int indexOfInsertBefore) {
                  if (log.isDebugEnabled()) {
                      log.debug("beforeHostChildAdded {}, {}, in this shadow {}", child,
                              insertBefore, ShadowElementsCtrl.getCurrentInfo());
                  }
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 5 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 run has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public void run() {
                  ++_nThd;
                  try {
                      while (_ceased == null) {
                          if (!isIdle()) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/impl/EventProcessingThreadImpl.java - About 5 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 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
                  final String cmd = request.getCommand();
                  if (cmd.equals(Events.ON_OPEN)) {
                      OpenEvent evt = OpenEvent.getOpenEvent(request);
          
          
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Treeitem.java - About 5 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 renderValue has 131 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private String renderValue(Object value) {
                  if (value == null || value instanceof String) {
                      return renderValue((String) value);
                  }
                  if (value instanceof Date) {
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 5 hrs to fix

            File CacheMap.java has 383 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* CacheMap.java
            
            
                Purpose: 
                Description: 
            Severity: Minor
            Found in zcommon/src/main/java/org/zkoss/util/CacheMap.java - About 5 hrs to fix

              Document has 39 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public class Document extends AbstractGroup implements org.w3c.dom.Document {
                  /** The document type. */
                  private DocType _docType;
                  /** The root element. */
                  private Element _root;
              Severity: Minor
              Found in zcommon/src/main/java/org/zkoss/idom/Document.java - About 5 hrs to fix
                Severity
                Category
                Status
                Source
                Language