fabiommendes/django-bricks

View on GitHub

Showing 65 of 97 total issues

Function bricks has 272 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var bricks = (function ($) {
    var json = bricks$json;
    var actions = bricks$actions;
    var util = bricks$util;
    var byId = util.byId;
Severity: Major
Found in src/bricks/app/static/js/bricks/core.js - About 1 day to fix

    Function bricks has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
    Open

    var bricks = (function ($) {
        var json = bricks$json;
        var actions = bricks$actions;
        var util = bricks$util;
        var byId = util.byId;
    Severity: Minor
    Found in src/bricks/app/static/js/bricks/core.js - About 1 day 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 bricks$json has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
    Open

    var bricks$json = (function ($) {
        function JsAction(js, result) {
            this.js = js;
            this.result = result
        };
    Severity: Minor
    Found in src/bricks/app/static/js/bricks/json.js - About 6 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

    File converter.py has 407 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import ast
    import collections
    import copy
    import io
    import sys
    Severity: Minor
    Found in src/bricks/ni/converter.py - About 5 hrs to fix

      Function bricks$json has 119 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var bricks$json = (function ($) {
          function JsAction(js, result) {
              this.js = js;
              this.result = result
          };
      Severity: Major
      Found in src/bricks/app/static/js/bricks/json.js - About 4 hrs to fix

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

        def lazy_singledispatch(func):
            """
            Single-dispatch generic function decorator.
        
            Transforms a function into a generic function, which can have different
        Severity: Minor
        Found in src/bricks/utils/generic.py - 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

        File client.py has 317 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import re
        from collections import UserString
        from functools import singledispatch
        
        from lazyutils import lazy
        Severity: Minor
        Found in src/bricks/js/client.py - About 3 hrs to fix

          JsTranspiler has 26 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class JsTranspiler(CClassTranspiler):
          
              def visit_body(self, seq, indent=True):
                  if indent:
                      self.indent_up()
          Severity: Minor
          Found in src/bricks/ni/converter.py - About 3 hrs to fix

            File core.js has 277 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            var bricks = (function ($) {
                var json = bricks$json;
                var actions = bricks$actions;
                var util = bricks$util;
                var byId = util.byId;
            Severity: Minor
            Found in src/bricks/app/static/js/bricks/core.js - About 2 hrs to fix

              Function json_codec_worker has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function json_codec_worker(json, encode) {
                      var decode = !encode;
                      var out, key;
              
                      // Don't like undefined values
              Severity: Major
              Found in src/bricks/app/static/js/bricks/json.js - About 2 hrs to fix

                Function bem_modifiers has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                def bem_modifiers(base, map=None, **states):
                    """
                    Return a list with BEM modifiers for a given class if marked states
                    are enabled.
                
                
                Severity: Minor
                Found in src/bricks/contrib/bem.py - 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

                File components.py has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                from functools import wraps
                
                import bricks.html5 as t
                from bricks.contrib.bem import bem_modifiers, bem_with_modifiers
                from bricks.helpers import join_classes
                Severity: Minor
                Found in src/bricks/contrib/mdl/components.py - About 2 hrs to fix

                  Function bricks$actions has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var bricks$actions = (function($) {
                      function statements(json) {
                          for (var i = 0; i < json.data.length; i++) {
                              bricks.exec(json.data[i]);
                          }
                  Severity: Minor
                  Found in src/bricks/app/static/js/bricks/commands.js - 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 require_deep has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def require_deep(elem):
                      """
                      Gather list of requirements by walking through all children starting
                      with the given element.
                      """
                  Severity: Minor
                  Found in src/bricks/assets/utils.py - 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 bricks$actions has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var bricks$actions = (function($) {
                      function statements(json) {
                          for (var i = 0; i < json.data.length; i++) {
                              bricks.exec(json.data[i]);
                          }
                  Severity: Minor
                  Found in src/bricks/app/static/js/bricks/commands.js - About 1 hr to fix

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

                    def bricks_register(view_cls, *args, name=None, register=True, **kwargs):
                        """
                        Worker function for api and program callbacks.
                        """
                    
                    
                    Severity: Minor
                    Found in src/bricks/rpc/decorators.py - 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 rpc has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        bricks.rpc = function (args) {
                            // Initialize parameters
                            args = $.extend({
                                api: undefined,
                                params: {},
                    Severity: Minor
                    Found in src/bricks/app/static/js/bricks/core.js - About 1 hr to fix

                      Function _getDialog has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function _getDialog(args, action) {
                              args = args || {};
                              var dialog = args.dialog || byId(args.dialogId || 'dialog');
                              var content = args.dialogContent || byId(args.dialogContentId || 'dialog-content');
                      
                      
                      Severity: Minor
                      Found in src/bricks/app/static/js/bricks/dialog.js - About 1 hr to fix

                        Function button has 11 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def button(children=None, class_=None,
                        Severity: Major
                        Found in src/bricks/contrib/mdl/components.py - About 1 hr to fix

                          Function getFormData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function getFormData(form) {
                                  var files = {};
                                  var pending = {__size: 0};
                                  var formData = {fileData: files, __pending: pending};
                                  var params = $(form).serializeArray();
                          Severity: Minor
                          Found in src/bricks/app/static/js/bricks/core.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language