christabor/flask_jsondash

View on GitHub

Showing 92 of 92 total issues

Avoid too many return statements within this function.
Open

        return true;
Severity: Major
Found in flask_jsondash/static/js/app.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return null;
    Severity: Major
    Found in flask_jsondash/static/js/utils.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          if(config.type === 'youtube') { return jsondash.handlers.handleYoutube(container, config); }
      Severity: Major
      Found in flask_jsondash/static/js/handlers.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            if(config.type === 'custom') { return jsondash.handlers.handleCustom(container, config); }
        Severity: Major
        Found in flask_jsondash/static/js/handlers.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return redirect(view_url)
          Severity: Major
          Found in flask_jsondash/charts_builder.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                if(config.type === 'circlepack') { return jsondash.handlers.handleCirclePack(container, config); }
            Severity: Major
            Found in flask_jsondash/static/js/handlers.js - About 30 mins to fix

              Function handleC3 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              jsondash.handlers.handleC3 = function(container, config) {
                  var _width = isNaN(config.width) ? jsondash.getDynamicWidth(container, config) : config.width;
                  'use strict';
                  var init_config = {
                      bindto: '[data-guid="' + config.guid + '"] .chart-container',
              Severity: Minor
              Found in flask_jsondash/static/js/handlers.js - About 25 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 url2wordcloud has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              def url2wordcloud(url, requests_kwargs={},
                                exclude_punct=True,
                                normalized=True,
                                limit=None,
                                size=1,
              Severity: Minor
              Found in flask_jsondash/data_utils/wordcloud.py - About 25 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 paginator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              def paginator(page=0, per_page=None, count=None):
                  """Get pagination calculations in a compact format."""
                  if count is None:
                      count = adapter.count()
                  if page is None:
              Severity: Minor
              Found in flask_jsondash/utils.py - About 25 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 dashboard has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              def dashboard():
                  """Load all views."""
                  opts = dict()
                  views = []
                  # Allow query parameter overrides.
              Severity: Minor
              Found in flask_jsondash/charts_builder.py - About 25 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 handleBasic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              jsondash.handlers.handleBasic = function(container, config) {
                  'use strict';
                  if(config.type === 'numbergroup') { return jsondash.handlers.handleNumbersGroup(container, config); }
                  if(config.type === 'number') { return jsondash.handlers.handleSingleNum(container, config); }
                  if(config.type === 'iframe') { return jsondash.handlers.handleIframe(container, config); }
              Severity: Minor
              Found in flask_jsondash/static/js/handlers.js - About 25 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 handleSingleNum has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              jsondash.handlers.handleSingleNum = function(container, config) {
                  'use strict';
                  jsondash.getJSON(container, config, function(error, res){
                      var data = res.data.data ? res.data.data : res.data;
                      var num = container
              Severity: Minor
              Found in flask_jsondash/static/js/handlers.js - About 25 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

              Severity
              Category
              Status
              Source
              Language