edgewall/trac

View on GitHub

Showing 1,369 of 1,369 total issues

File web_ui.py has 1599 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>
# All rights reserved.
Severity: Major
Found in trac/ticket/web_ui.py - About 4 days to fix

    Function get_sql has a Cognitive Complexity of 191 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_sql(self, req=None, cached_ids=None, authname=None):
            """Return a (sql, params) tuple for the query.
            """
            if req is not None:
                authname = req.authname
    Severity: Minor
    Found in trac/ticket/query.py - About 3 days 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_html has a Cognitive Complexity of 183 (exceeds 5 allowed). Consider refactoring.
    Open

        def _render_html(self, req, repos, chgset, restricted, data):
            """HTML version"""
            data['restricted'] = restricted
            display_rev = repos.display_rev
            data['display_rev'] = display_rev
    Severity: Minor
    Found in trac/versioncontrol/web_ui/changeset.py - About 3 days 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 formatter.py has 1348 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/formatter.py - About 3 days to fix

      File query.py has 1284 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      #
      # Copyright (C) 2004-2023 Edgewall Software
      # Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de>
      # Copyright (C) 2005-2007 Christian Boos <cboos@edgewall.org>
      Severity: Major
      Found in trac/ticket/query.py - About 3 days to fix

        File chrome.py has 1246 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/chrome.py - About 3 days to fix

          File model.py has 1204 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

            Function _render_view has a Cognitive Complexity of 148 (exceeds 5 allowed). Consider refactoring.
            Open

                def _render_view(self, req, id):
                    """Retrieve the report results and pre-process them for rendering."""
                    r = Report(self.env, id)
                    title, description, sql = r.title, r.description, r.query
            
            
            Severity: Minor
            Found in trac/ticket/report.py - About 3 days 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 _diff_to_hdf has a Cognitive Complexity of 146 (exceeds 5 allowed). Consider refactoring.
            Open

                def _diff_to_hdf(self, difflines, tabwidth):
                    """
                    Translate a diff file into something suitable for inclusion in HDF.
                    The result is [(filename, revname_old, revname_new, changes)],
                    where changes has the same format as the result of
            Severity: Minor
            Found in trac/mimeview/patch.py - About 2 days 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 __init__.py has 1137 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            #
            # Copyright (C) 2003-2023 Edgewall Software
            # Copyright (C) 2003-2006 Jonas Borgström <jonas@edgewall.com>
            # Copyright (C) 2006 Matthew Good <trac@matt-good.net>
            Severity: Major
            Found in trac/util/__init__.py - About 2 days to fix

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

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

                File changeset.py has 1030 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-2006 Christopher Lenz <cmlenz@gmx.de>
                Severity: Major
                Found in trac/versioncontrol/web_ui/changeset.py - About 2 days to fix

                  File datefmt.py has 1027 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  #
                  # Copyright (C) 2003-2023 Edgewall Software
                  # Copyright (C) 2003-2006 Jonas Borgström <jonas@edgewall.com>
                  # Copyright (C) 2006 Matthew Good <trac@matt-good.net>
                  Severity: Major
                  Found in trac/util/datefmt.py - About 2 days to fix

                    File _fcgi.py has 1020 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: iso-8859-1 -*-
                    #
                    # Copyright (c) 2002, 2003, 2005, 2006 Allan Saddi <allan@saddi.com>
                    # All rights reserved.
                    #
                    Severity: Major
                    Found in trac/web/_fcgi.py - About 2 days to fix

                      File svn_fs.py has 1015 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      #
                      # Copyright (C) 2005-2023 Edgewall Software
                      # Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
                      # Copyright (C) 2005-2007 Christian Boos <cboos@edgewall.org>
                      Severity: Major
                      Found in tracopt/versioncontrol/svn/svn_fs.py - About 2 days to fix

                        File roadmap.py has 952 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        #
                        # Copyright (C) 2004-2023 Edgewall Software
                        # Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de>
                        # Copyright (C) 2006-2007 Christian Boos <cboos@edgewall.org>
                        Severity: Major
                        Found in trac/ticket/roadmap.py - About 2 days to fix

                          File env.py has 949 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          #
                          # Copyright (C) 2003-2023 Edgewall Software
                          # Copyright (C) 2003-2007 Jonas Borgström <jonas@edgewall.com>
                          # All rights reserved.
                          Severity: Major
                          Found in trac/env.py - About 2 days to fix

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

                                def process_request(self, req):
                                    req.perm.require('LOG_VIEW')
                            
                                    mode = req.args.get('mode', 'stop_on_copy')
                                    path = req.args.get('path', '/')
                            Severity: Minor
                            Found in trac/versioncontrol/web_ui/log.py - About 2 days 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 attachment.py has 928 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 Christopher Lenz <cmlenz@gmx.de>
                            Severity: Major
                            Found in trac/attachment.py - About 2 days to fix

                              File PyGIT.py has 896 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/PyGIT.py - About 2 days to fix
                                Severity
                                Category
                                Status
                                Source
                                Language