edgewall/trac

View on GitHub

Showing 1,372 of 1,372 total issues

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

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

                  def _render_dir(self, req, repos, node, rev, order, desc):
              Severity: Minor
              Found in trac/versioncontrol/web_ui/browser.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if parent != parents[0]:
                                            thread.append([0, col, line])
                                        add_edge(thread, next_revs.index(parent), line + 1)
                Severity: Major
                Found in trac/versioncontrol/web_ui/util.py - About 45 mins to fix

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

                      def render_property_diff(self, name, old_context, old_props,
                  Severity: Minor
                  Found in trac/versioncontrol/web_ui/changeset.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if name and name != path_info and 'alias' not in info:
                                                cset_added = tag.code('trac-admin "%s" changeset '
                                                                      'added "%s" $REV'
                                                                      % (self.env.path,
                                                                         pretty_name))
                    Severity: Major
                    Found in trac/versioncontrol/admin.py - About 45 mins to fix

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

                      def get_path_links(href, reponame, path, rev, order=None, desc=None):
                      Severity: Minor
                      Found in trac/versioncontrol/web_ui/util.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            for line in tolines[j1:j2]:
                                                line = expandtabs(line, tabwidth, '\0\1')
                                                line = escape(line, quotes=False)
                                                line = '<ins>'.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

                                              for line in fromlines[i1:i2]:
                                                  yield '-' + line
                                          if tag in ('replace', 'insert'):
                          Severity: Major
                          Found in trac/versioncontrol/diff.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if 'dir' in changes:
                                                        msg = tag_('You should now run %(resync)s to '
                                                                   'synchronize Trac with the repository.',
                                                                   resync=resync)
                                                        add_notice(req, msg)
                            Severity: Major
                            Found in trac/versioncontrol/admin.py - About 45 mins to fix

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

                                  def render_property_diff(self, name, old_node, old_props,
                              Severity: Minor
                              Found in trac/versioncontrol/web_ui/changeset.py - About 45 mins to fix

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

                                def unified_diff(fromlines, tolines, context=None, ignore_blank_lines=0,
                                Severity: Minor
                                Found in trac/versioncontrol/diff.py - About 45 mins to fix

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

                                      def annotate(self, row, lineno):
                                          if lineno > len(self.annotations):
                                              row.append(tag.th())
                                              return
                                          rev = self.annotations[lineno-1]
                                  Severity: Minor
                                  Found in trac/versioncontrol/web_ui/browser.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

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

                                      def _render_file(self, req, context, repos, node, rev=None):
                                  Severity: Minor
                                  Found in trac/versioncontrol/web_ui/browser.py - About 45 mins to fix

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

                                        def _render_zip(self, req, context, repos, root_node, rev=None):
                                    Severity: Minor
                                    Found in trac/versioncontrol/web_ui/browser.py - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language