laboiteproject/lenuage

View on GitHub

Showing 179 of 384 total issues

Avoid deeply nested control flow statements.
Open

                    if app_instances.count() > 1:
                        verbose_name += ' ' + str(i + 1)
                    apps_list.append({'verbose_name': verbose_name[16:], 'pk': instance.pk, 'enabled': instance.enabled,
Severity: Major
Found in boites/views.py - About 45 mins to fix

    Function get_last_activity has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_last_activity(self):
            last_activity = None
            for app in self.tile_apps.all():
                try:
                    app.content_object.get_app_dictionary()
    Severity: Minor
    Found in boites/models.py - About 45 mins 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 update_data has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def update_data(self):
            params = {
                'dataset': 'tco-bus-circulation-passages-tr',
                'rows': 2,
                'apikey': settings.STAR_API_KEY,
    Severity: Minor
    Found in laboite/apps/bus/models.py - About 45 mins 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

    Consider simplifying this complex logical expression.
    Open

                if ( matcher[ expando ] ) {
                    // Find the next relative operator (if any) for proper handling
                    j = ++i;
                    for ( ; j < len; j++ ) {
                        if ( Expr.relative[ tokens[j].type ] ) {
    Severity: Major
    Found in static/dist/js/site-70bd78197e.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if ( delegateCount && cur.nodeType &&
                  ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
      
                  for ( ; cur !== this; cur = cur.parentNode || this ) {
      
      
      Severity: Major
      Found in static/dist/js/site-70bd78197e.js - About 40 mins to fix

        Function condense has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function condense( unmatched, map, filter, context, xml ) {
        Severity: Minor
        Found in static/dist/js/site-70bd78197e.js - About 35 mins to fix

          Function remove has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              remove: function( elem, types, handler, selector, mappedTypes ) {
          Severity: Minor
          Found in static/dist/js/site-70bd78197e.js - About 35 mins to fix

            Function superMatcher has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    superMatcher = function( seed, context, xml, results, outermost ) {
            Severity: Minor
            Found in static/dist/js/site-70bd78197e.js - About 35 mins to fix

              Function Tween has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function Tween( elem, options, prop, end, easing ) {
              Severity: Minor
              Found in static/dist/js/site-70bd78197e.js - About 35 mins to fix

                Function augmentWidthOrHeight has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
                Severity: Minor
                Found in static/dist/js/site-70bd78197e.js - About 35 mins to fix

                  Function buildFragment has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function buildFragment( elems, context, scripts, selection, ignored ) {
                  Severity: Minor
                  Found in static/dist/js/site-70bd78197e.js - About 35 mins to fix

                    Function CHILD has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            "CHILD": function( type, what, argument, first, last ) {
                    Severity: Minor
                    Found in static/dist/js/site-70bd78197e.js - About 35 mins to fix

                      Function add has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          add: function( elem, types, handler, data, selector ) {
                      Severity: Minor
                      Found in static/dist/js/site-70bd78197e.js - About 35 mins to fix

                        Function fillRect has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function fillRect(x0, y0,  width,  height, color) {
                        Severity: Minor
                        Found in laboite/static/js/gfx.js - About 35 mins to fix

                          Function drawRect has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          function drawRect(x0, y0,  width,  height, color) {
                          Severity: Minor
                          Found in laboite/static/js/gfx.js - About 35 mins to fix

                            Function drawChar has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            function drawChar(x0, y0, character, color, bg){
                            Severity: Minor
                            Found in laboite/static/js/gfx.js - About 35 mins to fix

                              Function printText has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              function printText(x, y, text, color, bg) {
                              Severity: Minor
                              Found in laboite/static/js/gfx.js - About 35 mins to fix

                                Function __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def __init__(self, *args, **kw):
                                        super(TasksModelForm, self).__init__(*args, **kw)
                                        widget = self.fields['asana_project_id'].widget
                                        value = ''
                                        if 'asana_personal_access_token' in self.data and self.data['asana_personal_access_token']:
                                Severity: Minor
                                Found in laboite/apps/tasks/forms.py - About 35 mins 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

                                Avoid too many return statements within this function.
                                Open

                                              return values[1];
                                Severity: Major
                                Found in static/dist/js/site-70bd78197e.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
                                  Severity: Major
                                  Found in static/dist/js/site-70bd78197e.js - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language