edgewall/trac

View on GitHub

Showing 1,050 of 1,372 total issues

Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, category, target, time, author, comment=None,
Severity: Major
Found in trac/ticket/notification.py - About 50 mins to fix

    Function get_href has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def get_href(self, href, id=None, order=None, desc=None, format=None,
    Severity: Major
    Found in trac/ticket/query.py - About 50 mins to fix

      Function extensionpoints_role has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def extensionpoints_role(name, rawtext, text, lineno, inliner, options={},
      Severity: Major
      Found in doc/conf.py - About 50 mins to fix

        Function teo_role has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def teo_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
        Severity: Major
        Found in doc/conf.py - About 50 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if prev:
                                  prev = 'equal', prev[1], i2, prev[3], j2
                              else:
                                  prev = 'equal', i1, i2, j1, j2
                              continue
          Severity: Major
          Found in trac/versioncontrol/diff.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                for line in tolines[j1:j2]:
                                    yield '+' + line
            
            
            Severity: Major
            Found in trac/versioncontrol/diff.py - About 45 mins to fix

              Function annotate_row has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def annotate_row(self, context, row, lineno, line, blame_annotator):
              Severity: Minor
              Found in trac/versioncontrol/web_ui/browser.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if 'svn:executable' in props:
                                        kwargs['executable'] = True
                                elif node.isdir and path:
                Severity: Major
                Found in trac/versioncontrol/web_ui/util.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      with content_closing(
                                              node.get_processed_content(eol_hint='CRLF')) \
                                              as content:
                                          data = content.read()
                                      props = node.get_properties()
                  Severity: Major
                  Found in trac/versioncontrol/web_ui/util.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if ($('em', cells[2]).length) oldTag = newTag = "\\";
                    Severity: Major
                    Found in trac/htdocs/js/diff.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (value is not None
                                                  or field in ('hidden', 'sync_per_request')) \
                                                      and value != info.get(field):
                                                  changes[field] = value
                                          if 'dir' in changes and not \
                      Severity: Major
                      Found in trac/versioncontrol/admin.py - About 45 mins to fix

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

                            def get_repositories(self):
                                """Retrieve repositories specified in the repository DB table."""
                                repos = {}
                                for id, name, value in self.env.db_query(
                                        "SELECT id, name, value FROM repository WHERE name IN (%s)"
                        Severity: Minor
                        Found in trac/versioncontrol/api.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

                        Avoid deeply nested control flow statements.
                        Open

                                                for name in sel:
                                                    db_provider.remove_repository(name)
                                                add_notice(req, _('The selected repositories have '
                        Severity: Major
                        Found in trac/versioncontrol/admin.py - About 45 mins to fix

                          Function _copy_tables has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def _copy_tables(self, dst_env, src_db, dst_db, src_dburi, dst_dburi):
                          Severity: Minor
                          Found in trac/env.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if section[user]:
                                                            return True
                                                        denied = True
                            Severity: Major
                            Found in trac/versioncontrol/svn_authz.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if not all_equal():
                                                      yield group
                                                  group = []
                              Severity: Major
                              Found in trac/versioncontrol/diff.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    for line in fromlines[i1:i2]:
                                                        line = expandtabs(line, tabwidth, '\0\1')
                                                        line = escape(line, quotes=False)
                                                        line = '<del>'.join(space_re.sub(htmlify, seg)
                                                                            for seg in line.split('\0'))
                                Severity: Major
                                Found in trac/versioncontrol/diff.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if 'id' not in info:
                                                              info['id'] = self.get_repository_id(reponame)
                                                          all_repositories[reponame] = info
                                  Severity: Major
                                  Found in trac/versioncontrol/api.py - About 45 mins to fix

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

                                        def truncate(self, curr_pair, new_pair=None):
                                            curr_pair = tuple(curr_pair)
                                            if new_pair:
                                                new_pair = tuple(new_pair)
                                            revranges = RevRanges(self.repos, resolve=self.resolve)
                                    Severity: Minor
                                    Found in trac/versioncontrol/web_ui/log.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

                                    Avoid deeply nested control flow statements.
                                    Open

                                                if ($('em', cells[1]).length) oldTag = "\\";
                                    Severity: Major
                                    Found in trac/htdocs/js/diff.js - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language