Showing 4,841 of 7,782 total issues

Function _deconstructPacket has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

        export function _deconstructPacket(data: ArrayBufferView | unknown & { buffer?} | undefined, buffers: unknown[]): unknown {
            if (!data) return data;

            if (_isBinary(data)) {
                const placeholder = { _placeholder: true, num: buffers.length };
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - About 2 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 layoutregion$mold$ has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function layoutregion$mold$(out) {
    var uuid = this.uuid,
        pos = this.getPosition(),
        BL = zul.layout.Borderlayout,
        noCenter = pos != BL.CENTER,
Severity: Minor
Found in zul/src/main/resources/web/js/zul/layout/mold/layoutregion.js - About 2 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 _scroll has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    _scroll(): void {
        var current = new Date(),
            delta = current.valueOf() - this.lastScrolled!.valueOf();
        this.lastScrolled = current;
        if (this.opts.scroll == window) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/drag.ts - About 2 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 _updateDrag has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    _updateDrag(pt: zk.Offset, evt: zk.Event): void {
        if (!this.dragging) {
            let v = this.opts.initSensitivity;
            if (v && pt[0] <= _initPt[0] + v && pt[0] >= _initPt[0] - v
            && pt[1] <= _initPt[1] + v && pt[1] >= _initPt[1] - v)
Severity: Minor
Found in zk/src/main/resources/web/js/zk/drag.ts - About 2 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 zkx has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    export function zkx(wi?: WidgetInfo, extra?: ExtraInfo, aucmds?: AuCmds, js?: string): void { //extra is either delay (BL) or [stub, filter] (AU)
        zk.mounting = true;

        try {
            if (js) jq.globalEval(js);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/mount.ts - About 2 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 create has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    create(context) {
        // eslint-disable-next-line @typescript-eslint/ban-ts-comment
        // @ts-ignore
        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
        const escapeFunc: string = context.options[0] && context.options[0]['escapeFunc'] || 'escape';
Severity: Minor
Found in eslint-plugin-zk/src/rules/noLocationHrefAssign.ts - About 2 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 get has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public V get(Object src) {
        WaitLock lock = null;
        for (;;) {
            Info ri = null;
Severity: Major
Found in zcommon/src/main/java/org/zkoss/util/resource/ResourceCache.java - About 2 hrs to fix

    Method renderBegin has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public void renderBegin(Component comp, Map clientEvents, String specialRendererOutput,
                boolean lookup) {
            if (_2ndChild.isEmpty())
                _jsout.append("zkx(");
            else if (_2ndChild.get(0) == Boolean.TRUE)
    Severity: Major
    Found in zhtml/src/main/java/org/zkoss/zhtml/impl/TagRenderContext.java - About 2 hrs to fix

      Method CompositeExpression has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        final public AstCompositeExpression CompositeExpression() throws ParseException {
                                                                           /*@bgen(jjtree) CompositeExpression */
        AstCompositeExpression jjtn000 = new AstCompositeExpression(JJTCOMPOSITEEXPRESSION);
        boolean jjtc000 = true;
        jjtree.openNodeScope(jjtn000);
      Severity: Major
      Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 2 hrs to fix

        Method createProxyIfAny has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @SuppressWarnings({ "unchecked", "rawtypes" })
            public static <T> T createProxyIfAny(T origin, Annotation[] annotations) {
                if (origin == null)
                    return null;
                if (origin instanceof FormProxyObject) {
        Severity: Major
        Found in zkbind/src/main/java/org/zkoss/bind/proxy/ProxyHelper.java - About 2 hrs to fix

          Method renderTabpanel has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public void renderTabpanel(Tabpanel item, final Object data, final int index) throws Exception {
                  final Tabbox tabbox = item.getTabbox();
                  final Tabpanels tabpanels = tabbox.getTabpanels();
                  final int size = tabbox.getModel().getSize();
                  final String tmn = "model";
          Severity: Major
          Found in zkbind/src/main/java/org/zkoss/bind/impl/BindTabboxRenderer.java - About 2 hrs to fix

            File BindUiLifeCycle.java has 260 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* BindUiLifeCycle.java
            
                Purpose:
                    
                Description:
            Severity: Minor
            Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/BindUiLifeCycle.java - About 2 hrs to fix

              Method render has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public void render(ActionContext ac, boolean nested) throws DspException, IOException {
                      //at least items or end must be specified
                      if (!nested || (_itemsSpecified && _items == null) || (_endSpecified && _end < _beg)
                              || (!_itemsSpecified && !_endSpecified) || !isEffective())
                          return;
              Severity: Major
              Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java - About 2 hrs to fix

                Function tick has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function tick() {
                    var n = nodes.length,
                        m = links.length,
                        q,
                        i, // current index
                Severity: Major
                Found in zktest/src/main/webapp/js/d3.layout.js - About 2 hrs to fix

                  Method init has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public void init(Component comp, Object viewModel, Map<String, Object> initArgs) {
                          if (_init)
                              throw new UiException("binder is already initialized");
                          _init = true;
                  
                  
                  Severity: Major
                  Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 2 hrs to fix

                    Method render has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public String render(final Component owner, final Object data, final int index) {
                                final Selectbox self = (Selectbox) owner;
                                final Template tm = self.getTemplate("model");
                                if (tm == null)
                                    return Objects.toString(data);
                    Severity: Major
                    Found in zul/src/main/java/org/zkoss/zul/Selectbox.java - About 2 hrs to fix

                      Method fixGroupsInfoBeforeInsert has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private void fixGroupsInfoBeforeInsert(Component newChild, Component refChild, boolean isReorder) {
                              if (_isReplacingItem) //@see Renderer#render
                                  return; //called by #insertBefore(), skip handling GroupInfo
                      
                              if (newChild instanceof Listgroupfoot) {
                      Severity: Major
                      Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 2 hrs to fix

                        Function zoom has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        d3.behavior.zoom = function() {
                          var xyz = [0, 0, 0],
                              event = d3.dispatch("zoom");
                        
                          function zoom() {
                        Severity: Major
                        Found in zktest/src/main/webapp/js/d3.js - About 2 hrs to fix

                          File Listitem.java has 257 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

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

                            CollectionsX has 21 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            public class CollectionsX {
                                /** An enumeration on top of a collection or iterator.
                                 */
                                public static final class CollectionEnumeration<E> implements Enumeration<E> {
                                    private final Iterator<? extends E> _iter;
                            Severity: Minor
                            Found in zcommon/src/main/java/org/zkoss/util/CollectionsX.java - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language