Showing 7,775 of 7,775 total issues

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

    public static final void render(ServletContext ctx, HttpServletRequest request, HttpServletResponse response,
            Richlet richlet, String path, boolean pageDOM, Writer out) throws ServletException, IOException {
        if (path == null)
            path = Https.getThisServletPath(request);

Severity: Minor
Found in zkplus/src/main/java/org/zkoss/zkplus/embed/Renders.java - About 1 hr to fix

    Method putAll has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public void putAll(Map<? extends K, ? extends V> c) {
            if (c == _map) //special case
                return;
    
            if (_map instanceof LinkedHashMap) {
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 1 hr to fix

      Method getAttributeNames has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public Enumeration getAttributeNames() {
              final Enumeration _e = _req.getAttributeNames();
              final Iterator _it = _attrs.keySet().iterator();
              return new Enumeration() {
                  Object _next;

        Function d3_dispatch has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function d3_dispatch(type) {
          var dispatch = {},
              listeners = [];
        
          dispatch.add = function(listener) {
        Severity: Minor
        Found in zktest/src/main/webapp/js/d3.js - About 1 hr to fix

          Function firstWalk has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function firstWalk(node, previousSibling) {
                var children = node.children,
                    layout = node._tree;
                if (children && (n = children.length)) {
                  var n,
          Severity: Minor
          Found in zktest/src/main/webapp/js/d3.layout.js - About 1 hr to fix

            Function drag has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            d3.behavior.drag = function() {
              var event = d3.dispatch("drag", "dragstart", "dragend");
            
              function drag() {
                this
            Severity: Minor
            Found in zktest/src/main/webapp/js/d3.js - About 1 hr to fix

              Function wiggle has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                "wiggle": function(data) {
                  var n = data.length,
                      x = data[0],
                      m = x.length,
                      max = 0,
              Severity: Minor
              Found in zktest/src/main/webapp/js/d3.layout.js - About 1 hr to fix

                Function finish has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    finish: function( type ) {
                        if ( type !== false ) {
                            type = type || "fx";
                        }
                        return this.each( function() {
                Severity: Minor
                Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

                  Function off has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      off: function( types, selector, fn ) {
                          var handleObj, type;
                          if ( types && types.preventDefault && types.handleObj ) {
                  
                              // ( event )  dispatched jQuery.Event
                  Severity: Minor
                  Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

                    Function parseHTML has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    jQuery.parseHTML = function( data, context, keepScripts ) {
                        if ( typeof data !== "string" ) {
                            return [];
                        }
                        if ( typeof context === "boolean" ) {
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

                      Function addChd has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  export function addChd(wgt: zk.Widget, ...rargs: string[]): void {
                                      if (wgt) {
                                          const onSizeChildren: zk.Widget[] = [],
                                              fn = function (child: zk.Widget): void {
                                                  const act = _beforeAction(child, 'show') as never,
                      Severity: Minor
                      Found in zk/src/main/resources/web/js/zk/au.ts - About 1 hr to fix

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

                          Function setLoaded has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function setLoaded(pkg: string, wait?: boolean): void { //internal
                              _xloadings.$remove(pkg);
                              _loading[pkg] = true;
                          
                              if (wait) {
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/pkg.ts - About 1 hr to fix

                            Function isParameter has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                isParameter: function (node: TSESTree.Node, expr: TSESTree.Node) {
                            
                                    if (expr.type === 'CallExpression') {
                            
                                        // Check whether any of the call arguments equals the node.
                            Severity: Minor
                            Found in eslint-plugin-zk/src/tree.ts - About 1 hr to fix

                              Function _swipeEnd has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  _swipeEnd(devt: JQuery.TriggeredEvent): void {
                                      jq(this.node).off(moveEvt, this.proxy(this._swipeMove));
                                      if (start && stop && this.opts) {
                                          var dispX: number | undefined, dispY: number | undefined,
                                              dispT = stop.time - start.time, dir: 'left' | 'right' | 'up' | 'down' | undefined;
                              Severity: Minor
                              Found in zk/src/main/resources/web/js/zk/zswipe.ts - About 1 hr to fix

                                Function snap has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function snap(dg: zk.Draggable, pointer: zk.Offset): zk.Offset {
                                    var x = pointer[0],
                                        y = pointer[1];
                                    if (dg._isVer) {
                                        var move = y;
                                Severity: Minor
                                Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 1 hr to fix

                                  Function CallExpression has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              CallExpression(node) {
                                                  const { callee } = node;
                                                  if (callee.type !== AST_NODE_TYPES.MemberExpression ||
                                                      callee.object.type !== AST_NODE_TYPES.Identifier ||
                                                      callee.object.name !== 'zk' ||
                                  Severity: Minor
                                  Found in eslint-plugin-zk/src/rules/preferNativeClass.ts - About 1 hr to fix

                                    Function AssignmentExpression has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                AssignmentExpression: function (node) {
                                                    const left = node.left as TSESTree.Expression & {property?: {name: string}, object: {name: string, property?: TSESTree.Identifier}};
                                                    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
                                                    const isHref: boolean = left.property?.name === 'href';
                                                    if (!isHref) {
                                    Severity: Minor
                                    Found in eslint-plugin-zk/src/rules/noLocationHrefAssign.ts - About 1 hr to fix

                                      Similar blocks of code found in 6 locations. Consider refactoring.
                                      Open

                                          public void afterShadowAttached(ShadowElement shadow, Component host) {
                                              final UiLifeCycle[] ary = _uiCycles.toArray();
                                              for (int j = 0; j < ary.length; ++j) {
                                                  try {
                                                      ary[j].afterShadowAttached(shadow, host);
                                      Severity: Major
                                      Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 1 hr to fix
                                      zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1141..1150
                                      zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1156..1165
                                      zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1223..1232
                                      zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1253..1262
                                      zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1268..1277

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 77.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 6 locations. Consider refactoring.
                                      Open

                                          public void afterShadowDetached(ShadowElement shadow, Component prevhost) {
                                              final UiLifeCycle[] ary = _uiCycles.toArray();
                                              for (int j = 0; j < ary.length; ++j) {
                                                  try {
                                                      ary[j].afterShadowDetached(shadow, prevhost);
                                      Severity: Major
                                      Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 1 hr to fix
                                      zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1141..1150
                                      zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1156..1165
                                      zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1208..1217
                                      zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1253..1262
                                      zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1268..1277

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 77.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language