edgewall/trac

View on GitHub

Showing 1,048 of 1,370 total issues

Avoid too many return statements within this function.
Open

                return ''
Severity: Major
Found in trac/ticket/roadmap.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return tag.div(
    Severity: Major
    Found in trac/ticket/query.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return tag.span(alist[0], *[(', ', a) for a in alist[1:]])
      Severity: Major
      Found in trac/ticket/query.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return tag.div(
        Severity: Major
        Found in trac/ticket/query.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return tag.div(tag.dl([(tag.dt(ticket_anchor(ticket)),
          Severity: Major
          Found in trac/ticket/query.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                return ("COALESCE(%s,'')%s=%%s"
            Severity: Major
            Found in trac/ticket/query.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                  return (('NOT ' if neg else '')
              Severity: Major
              Found in trac/ticket/query.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return 'ticket_preview.html', data
                Severity: Major
                Found in trac/ticket/web_ui.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return resolved
                  Severity: Major
                  Found in tracopt/versioncontrol/git/PyGIT.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return rc
                    Severity: Major
                    Found in tracopt/versioncontrol/git/PyGIT.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return None                     # no match for action, can't decide
                      Severity: Major
                      Found in tracopt/perm/authz_policy.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return None
                        Severity: Major
                        Found in tracopt/versioncontrol/git/PyGIT.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return 'ticket.html', data
                          Severity: Major
                          Found in trac/ticket/web_ui.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return None
                            Severity: Major
                            Found in tracopt/versioncontrol/git/PyGIT.py - About 30 mins to fix

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

                                  def get_repository_by_path(self, path):
                                      """Retrieve a matching `Repository` for the given `path`.
                              
                                      :param path: the eventually scoped repository-scoped path
                                      :return: a `(reponame, repos, path)` triple, where `path` is
                              Severity: Minor
                              Found in trac/versioncontrol/api.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 _normrev has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def _normrev(self, rev):
                                      if not rev:
                                          raise NoSuchChangeset(rev)
                                      if self.resolve:
                                          return self.repos.normalize_rev(rev)
                              Severity: Minor
                              Found in trac/versioncontrol/web_ui/log.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 get_real_repositories has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def get_real_repositories(self):
                                      """Return a sorted list of all real repositories (i.e. excluding
                                      aliases).
                                      """
                                      repositories = set()
                              Severity: Minor
                              Found in trac/versioncontrol/api.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 component_guard has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def component_guard(self, component, reraise=False):
                                      """Traps any runtime exception raised when working with a component
                                      and logs the error.
                              
                                      :param component: the component responsible for any error that
                              Severity: Minor
                              Found in trac/env.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 get_resource_url has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def get_resource_url(self, resource, href, **kwargs):
                                      if resource.realm == self.changeset_realm:
                                          parent = resource.parent
                                          return href.changeset(resource.id, parent and parent.id or None)
                                      elif resource.realm == self.source_realm:
                              Severity: Minor
                              Found in trac/versioncontrol/api.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 _prepare_diff has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def _prepare_diff(self, req, page, old_text, new_text,
                                                    old_version, new_version):
                                      diff_style, diff_options, diff_data = get_diff_options(req)
                                      diff_context = 3
                                      for option in diff_options:
                              Severity: Minor
                              Found in trac/wiki/web_ui.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