mwielgoszewski/doorman

View on GitHub

Showing 51 of 341 total issues

Avoid too many return statements within this function.
Open

            return True
Severity: Major
Found in doorman/users/forms.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return False
    Severity: Major
    Found in doorman/users/forms.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return jsonify(node_key=existing_node.node_key, node_invalid=False)
      Severity: Major
      Found in doorman/api.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return False
        Severity: Major
        Found in doorman/users/forms.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return jsonify(node_key=node.node_key, node_invalid=False)
          Severity: Major
          Found in doorman/api.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return True
            Severity: Major
            Found in doorman/users/forms.py - About 30 mins to fix

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

              def get_node(node_id):
                  node = Node.query.filter_by(id=node_id).first_or_404()
                  form = UpdateNodeForm(request.form)
              
                  if form.validate_on_submit():
              Severity: Minor
              Found in doorman/manage/views.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 handle_status has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def handle_status(self, data, **kwargs):
                      if self.fp is None:
                          return
              
                      fp = self.fp
              Severity: Minor
              Found in doorman/plugins/logs/logstash.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 handle_log_entry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def handle_log_entry(self, entry, node):
                      """ The actual entrypoint for handling input log entries. """
                      from doorman.models import Rule
                      from doorman.rules import RuleMatch
                      from doorman.utils import extract_results
              Severity: Minor
              Found in doorman/extensions.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 local_run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def local_run(self, input):
                      # If we have a 'column_name', we should use that to extract the value
                      # from the input's columns.  Otherwise, we have a whitelist of what we
                      # can get from the input.
                      if self.column_name is not None:
              Severity: Minor
              Found in doorman/rules.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 distributed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              def distributed(node_id=None, status=None, page=1):
                  tasks = DistributedQueryTask.query
              
                  if status == 'new':
                      tasks = tasks.filter_by(status=DistributedQueryTask.NEW)
              Severity: Minor
              Found in doorman/manage/views.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