edgewall/trac

View on GitHub

Showing 1,372 of 1,372 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    Table('cache', key='id')[
        Column('id', type='int'),
        Column('generation', type='int'),
        Column('key')],
Severity: Major
Found in trac/db_default.py and 1 other location - About 1 hr to fix
trac/upgrades/db27.py on lines 21..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    Table('enum', key=('type', 'name'))[
        Column('type'),
        Column('name'),
        Column('value'),
        Column('description')],
Severity: Major
Found in trac/db_default.py and 1 other location - About 1 hr to fix
trac/upgrades/db44.py on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if pairs:
            revranges.a = pairs[0][0]
            revranges.b = pairs[-1][1]
Severity: Major
Found in trac/versioncontrol/web_ui/log.py and 1 other location - About 1 hr to fix
trac/util/__init__.py on lines 1165..1167

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if not egg_cache and options.get('TracEnvParentDir'):
                egg_cache = os.path.join(options.get('TracEnvParentDir'), '.egg-cache')
Severity: Major
Found in trac/web/modpython_frontend.py and 1 other location - About 1 hr to fix
trac/web/modpython_frontend.py on lines 139..140

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if prev_version:
            add_link(req, 'prev', req.href.wiki(page.name, action='diff',
                                                version=prev_version),
                     _("Version %(num)s", num=prev_version))
Severity: Major
Found in trac/wiki/web_ui.py and 1 other location - About 1 hr to fix
trac/wiki/web_ui.py on lines 481..484

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function enableCollapsibleColumns has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  $.fn.enableCollapsibleColumns = function(recovery_area) {
    // column headers
    var c_h_row = $('thead tr', this);
    var column_headers = $('th', c_h_row).not(recovery_area);
    var k = column_headers.length;
Severity: Minor
Found in trac/htdocs/js/folding.js - About 1 hr to fix

    Function display_html has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def display_html(self, req, query):
            # The most recent query is stored in the user session;
            orig_list = None
            orig_time = datetime_now(utc)
            query_time = req.session.as_int('query_time', 0)
    Severity: Minor
    Found in trac/ticket/query.py - About 1 hr to fix

      Function _insert_ticket_data has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def _insert_ticket_data(self, req, ticket, data, author_id, field_changes):
              """Insert ticket data into the template `data`"""
              replyto = req.args.get('replyto')
              data['replyto'] = replyto
              data['version'] = ticket.resource.version
      Severity: Minor
      Found in trac/ticket/web_ui.py - About 1 hr to fix

        Function appendBatchListControls has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function appendBatchListControls(td, propertyName, inputName) {
              var modeSelect = createSelect("batchmod_mode_" + propertyName,
                                            batch_list_modes).attr("id", inputName);
              var name1 = "batchmod_primary_" + propertyName;
              var name2 = "batchmod_secondary_" + propertyName;
        Severity: Minor
        Found in trac/htdocs/js/query.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                  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:
                      parent = resource.parent
          Severity: Major
          Found in trac/versioncontrol/api.py - About 1 hr to fix

            Function _from_database has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def _from_database(self, id, sid, authenticated, distributor, format,
            Severity: Major
            Found in trac/notification/model.py - About 1 hr to fix

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

                  def __init__(self, section, name, interface, default=None,
              Severity: Major
              Found in trac/config.py - About 1 hr to fix

                Function init_db has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def init_db(self, path, schema=None, log=None, user=None, password=None,
                Severity: Major
                Found in trac/db/postgres_backend.py - About 1 hr to fix

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

                      def __init__(self, section, name, default=None, sep=',', keep_empty=False,
                  Severity: Major
                  Found in trac/config.py - About 1 hr to fix

                    Function init_db has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def init_db(self, path, schema=None, log=None, user=None, password=None,
                    Severity: Major
                    Found in trac/db/mysql_backend.py - About 1 hr to fix

                      Function preview_data has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def preview_data(self, context, content, length, mimetype, filename,
                      Severity: Major
                      Found in trac/mimeview/api.py - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if not ticket.exists and 'owner' not in updated:
                                    updated['owner'] = self._sub_owner_keyword(ticket['owner'], ticket)
                                elif ticket['status'] == 'new' and \
                                        'component' in ticket.values and \
                                        'component' in ticket._old and \
                        Severity: Major
                        Found in trac/ticket/default_workflow.py - About 1 hr to fix

                          Similar blocks of code found in 3 locations. Consider refactoring.
                          Open

                              Table('repository', key=('id', 'name'))[
                                  Column('id', type='int'),
                                  Column('name'),
                                  Column('value')],
                          Severity: Major
                          Found in trac/db_default.py and 2 other locations - About 1 hr to fix
                          trac/db_default.py on lines 140..143
                          trac/upgrades/db24.py on lines 34..37

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 38.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 3 locations. Consider refactoring.
                          Open

                              tables = [Table('repository', key=('id', 'name'))[
                                            Column('id', type='int'),
                                            Column('name'),
                                            Column('value')],
                          Severity: Major
                          Found in trac/upgrades/db24.py and 2 other locations - About 1 hr to fix
                          trac/db_default.py on lines 87..90
                          trac/db_default.py on lines 140..143

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 38.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              if namelen < 128:
                                  namelen = _code2bytes(namelen)
                              else:
                                  namelen = struct.pack('!L', namelen | 0x80000000)
                          Severity: Major
                          Found in trac/web/_fcgi.py and 1 other location - About 1 hr to fix
                          trac/web/_fcgi.py on lines 427..430

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 38.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language