Showing 4,841 of 7,782 total issues

Function scale has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    scale(digits: number): void {
        var val = this._value || '',
            n = val.length;
        if (n)
            if (digits > 0) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/math.ts - 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

Function _constructPacket has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

        export function _constructPacket(data: unknown | undefined, files: unknown[]): unknown {
            if (!data) return data;
            if (Array.isArray(data)) {
                for (let i = 0; i < data.length; i++) {
                    data[i] = _constructPacket(data[i] as never, files);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - 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

Function addAft has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

            export function addAft(wgt: zk.Widget, ...codes: string[]): void {
                const p = wgt.parent,
                    onSizeChildren: zk.Widget[] = [],
                    fn = function (child: zk.Widget): void {
                        var act = _beforeAction(child, 'show') as never;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - 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

Function delayFunction has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export function delayFunction(uuid: string, func: () => void, opts?: Partial<{ timeout: number; urgent: boolean }>): void {
    if (uuid && typeof func == 'function') {
        if (!opts)
            opts = {};
        var timeout = opts.timeout,
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - 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 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public final void run(IN input) {
        
        C inputClass = getClass(input);
        
        doDebug("");
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/fsm/StateMachine.java - About 1 hr to fix

    Method parseToMap has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static final Map<String, String> parseToMap(Map<String, String> map, String rawData) {
            if (rawData == null || rawData.trim().length() == 0) {
                if (map != null)
                    return map;
                return Collections.emptyMap();
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/idom/ProcessingInstruction.java - About 1 hr to fix

      Method coerceToTypeForSetValue has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected static final Object coerceToTypeForSetValue(final Object obj,
                  Class<?> type) throws ELException {
              if (type == null || Object.class.equals(type) ||
                      (obj != null && type.isAssignableFrom(obj.getClass()))) {
                  return obj;
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java - About 1 hr to fix

        Method process has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected void process(HttpServletRequest request, HttpServletResponse response, String content)
                    throws ServletException, IOException {
                if (log.isDebugEnabled())
                    log.debug("Content to filter:\n{}", content);
        
        
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutFilter.java - About 1 hr to fix

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

              public void init() throws ServletException {
                  final ServletConfig config = getServletConfig();
                  final ServletContext ctx = getServletContext();
                  ctx.setAttribute(ATTR_UPDATE_SERVLET, this);
          
          
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.java - About 1 hr to fix

            Method doDeactivate has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static final void doDeactivate(Execution exec) {
                    //        if (log.finerable()) log.finer("Deactivating "+desktop);
            
                    final ExecutionCtrl execCtrl = (ExecutionCtrl) exec;
                    final Desktop desktop = exec.getDesktop();
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 1 hr to fix

              Method lookupParameterNames has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public String[] lookupParameterNames(AccessibleObject methodOrCtor, boolean throwExceptionIfMissing) {
              
                      Class<?>[] types = null;
                      Class<?> declaringClass = null;
                      String name = null;

                Method resolveParameter has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected Object resolveParameter(Annotation[] parmAnnos, Class<?> paramType, Method method, int index) {
                        Object val = null;
                        boolean hitResolver = false;
                        Default defAnno = null;
                        for (Annotation anno : parmAnnos) {
                Severity: Minor
                Found in zkbind/src/main/java/org/zkoss/bind/impl/ParamCall.java - About 1 hr to fix

                  Method doInitRenderer has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private void doInitRenderer() {
                          if (getPage() == null)
                              return;
                          final Renderer renderer = new Renderer();
                          try {
                  Severity: Minor
                  Found in zul/src/main/java/org/zkoss/zul/Grid.java - About 1 hr to fix

                    Method fixGroupsInfoAfterRemove has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private void fixGroupsInfoAfterRemove(Component child, int index) {
                            if (!_isReplacingItem) { //@see Renderer#render
                                //called by #removeChild(), handling GroupInfo if !isReplcingItem
                                if (child instanceof Listgroup) {
                                    int[] prev = null, remove = null;
                    Severity: Minor
                    Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

                      Function extend has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      jQuery.extend = jQuery.fn.extend = function() {
                          var options, name, src, copy, copyIsArray, clone,
                              target = arguments[ 0 ] || {},
                              i = 1,
                              length = arguments.length,
                      Severity: Minor
                      Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

                        Function _checkValidNamespace has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            const _checkValidNamespace = function _checkValidNamespace(element) {
                              let parent = getParentNode(element);
                        
                              // In JSDOM, if we're inside shadow DOM, then parentNode
                              // can be null. We just simulate parent in this case.
                        Severity: Minor
                        Found in zk/src/main/resources/web/js/zk/ext/purify.js - About 1 hr to fix

                          Function computeWeekdaysParse has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function computeWeekdaysParse() {
                                  function cmpLenRev(a, b) {
                                      return b.length - a.length;
                                  }
                          
                          
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

                            Function _create0 has 43 lines of code (exceeds 25 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 1 hr to fix

                              Function create has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  create(context) {
                                      return {
                                          CallExpression(node) {
                                              const { parent, callee } = node;
                              
                              
                              Severity: Minor
                              Found in eslint-plugin-zk/src/rules/noTopLevelScopingIIFE.ts - About 1 hr to fix

                                Method myGetCloseMethod has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private static final
                                    Method myGetCloseMethod(final Class<?> cls, final String name,
                                    final Class<?>[] argTypes, final boolean bySubclass)
                                    throws NoSuchMethodException {
                                //        assert argTypes != null: "Caller shall handle null";
                                Severity: Minor
                                Found in zcommon/src/main/java/org/zkoss/lang/Classes.java - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language