edgewall/trac

View on GitHub

Showing 1,048 of 1,370 total issues

File api.py has 895 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2023 Edgewall Software
# Copyright (C) 2004 Daniel Lundin <daniel@edgewall.com>
# Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de>
Severity: Major
Found in trac/mimeview/api.py - About 2 days to fix

    File api.py has 891 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    #
    # Copyright (C) 2005-2023 Edgewall Software
    # Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de>
    # All rights reserved.
    Severity: Major
    Found in trac/web/api.py - About 2 days to fix

      File macros.py has 844 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      #
      # Copyright (C) 2005-2023 Edgewall Software
      # Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de>
      # All rights reserved.
      Severity: Major
      Found in trac/wiki/macros.py - About 2 days to fix

        File browser.py has 834 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        #
        # Copyright (C) 2003-2023 Edgewall Software
        # Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
        # Copyright (C) 2005-2007 Christian Boos <cboos@edgewall.org>
        Severity: Major
        Found in trac/versioncontrol/web_ui/browser.py - About 2 days to fix

          File config.py has 802 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          #
          # Copyright (C) 2005-2023 Edgewall Software
          # Copyright (C) 2005-2007 Christopher Lenz <cmlenz@gmx.de>
          # All rights reserved.
          Severity: Major
          Found in trac/config.py - About 1 day to fix

            File html.py has 797 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            #
            # Copyright (C) 2003-2023 Edgewall Software
            # All rights reserved.
            #
            Severity: Major
            Found in trac/util/html.py - About 1 day to fix

              Function extract_python has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
              Open

                  def extract_python(fileobj, keywords, comment_tags, options):
                      """Extract messages from Python source code, This is patched
                      extract_python from Babel to support keyword argument mapping.
              
                      `kwargs_maps` option: names of keyword arguments will be mapping to
              Severity: Minor
              Found in trac/dist.py - About 1 day 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

              File report.py has 783 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              #
              # Copyright (C) 2003-2023 Edgewall Software
              # Copyright (C) 2003-2004 Jonas Borgström <jonas@edgewall.com>
              # Copyright (C) 2006 Christian Boos <cboos@edgewall.org>
              Severity: Major
              Found in trac/ticket/report.py - About 1 day to fix

                Function render_admin_panel has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
                Open

                    def render_admin_panel(self, req, category, page, path_info):
                        # Retrieve info for all repositories
                        rm = RepositoryManager(self.env)
                        all_repos = rm.get_all_repositories()
                        db_provider = self.env[DbRepositoryProvider]
                Severity: Minor
                Found in trac/versioncontrol/admin.py - About 1 day 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 filter_ignorable_lines has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
                Open

                def filter_ignorable_lines(hunks, fromlines, tolines, context,
                                           ignore_blank_lines, ignore_case,
                                           ignore_space_changes):
                    """Detect line changes that should be ignored and emits them as
                    tagged as "equal", possibly joined with the preceding and/or
                Severity: Minor
                Found in trac/versioncontrol/diff.py - About 1 day 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_timeline_event has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
                Open

                    def render_timeline_event(self, context, field, event):
                        changesets, show_location, show_files = event[3]
                        cset, cset_resource, repos_for_uid = changesets[0]
                        older_cset = changesets[-1][0]
                        message = cset.message or ''
                Severity: Minor
                Found in trac/versioncontrol/web_ui/changeset.py - About 1 day 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 expand_macro has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
                Open

                    def expand_macro(self, formatter, name, content):
                        args = None
                        if content:
                            content = stripws(content)
                            # parse arguments
                Severity: Minor
                Found in trac/wiki/macros.py - About 1 day 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

                File git_fs.py has 746 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                #
                # Copyright (C) 2012-2023 Edgewall Software
                # Copyright (C) 2006-2011, Herbert Valerio Riedel <hvr@gnu.org>
                # All rights reserved.
                Severity: Major
                Found in tracopt/versioncontrol/git/git_fs.py - About 1 day to fix

                  Function get_timeline_events has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def get_timeline_events(self, req, start, stop, filters):
                          ts_start = to_utimestamp(start)
                          ts_stop = to_utimestamp(stop)
                  
                          status_map = {'new': ('newticket', 'created'),
                  Severity: Minor
                  Found in trac/ticket/web_ui.py - About 1 day 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

                  File mail.py has 714 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  #
                  # Copyright (C) 2003-2023 Edgewall Software
                  # Copyright (C) 2003-2005 Daniel Lundin <daniel@edgewall.com>
                  # Copyright (C) 2005-2006 Emmanuel Blot <emmanuel.blot@free.fr>
                  Severity: Major
                  Found in trac/notification/mail.py - About 1 day to fix

                    File main.py has 713 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    #
                    # Copyright (C) 2005-2023 Edgewall Software
                    # Copyright (C) 2005-2007 Christopher Lenz <cmlenz@gmx.de>
                    # Copyright (C) 2005 Matthew Good <trac@matt-good.net>
                    Severity: Major
                    Found in trac/web/main.py - About 1 day to fix

                      Function process_request has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def process_request(self, req):
                              presel = req.args.get('preselected')
                              if presel and (presel + '/').startswith(req.href.browser() + '/'):
                                  req.redirect(presel)
                      
                      
                      Severity: Minor
                      Found in trac/versioncontrol/web_ui/browser.py - About 1 day 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

                      File web_ui.py has 690 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      #
                      # Copyright (C) 2003-2023 Edgewall Software
                      # Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
                      # Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de>
                      Severity: Major
                      Found in trac/wiki/web_ui.py - About 1 day to fix

                        File admin.py has 682 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        #
                        # Copyright (C) 2005-2023 Edgewall Software
                        # All rights reserved.
                        #
                        Severity: Major
                        Found in trac/ticket/admin.py - About 1 day to fix

                          File perm.py has 664 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          #
                          # Copyright (C) 2003-2023 Edgewall Software
                          # Copyright (C) 2003-2004 Jonas Borgström <jonas@edgewall.com>
                          # Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
                          Severity: Major
                          Found in trac/perm.py - About 1 day to fix
                            Severity
                            Category
                            Status
                            Source
                            Language