ZuluPro/myblog

View on GitHub

Showing 64 of 163 total issues

Avoid too many return statements within this function.
Open

      return el.hide();
Severity: Major
Found in myblog/myapp/static/zinnia/js/foundation/foundation.reveal.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return el.show();
    Severity: Major
    Found in myblog/myapp/static/zinnia/js/foundation/foundation.reveal.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                return $.get(path, function (response) {
                  el.html(response);
                  el.data(self.data_attr + '-last-path', path);
                  trigger();
                });
      Severity: Major
      Found in myblog/myapp/static/zinnia/js/foundation/foundation.interchange.js - About 30 mins to fix

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

            def _format_templates(self):
                text = ''
                for i, conf in enumerate(s.TEMPLATES):
                    text += self._format_section(i, fill='-')
                    text += self._format_key_value('APP_DIRS', conf['APP_DIRS'])
        Severity: Minor
        Found in myblog/myapp/setting_formatters/formatters.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

        Severity
        Category
        Status
        Source
        Language