TabbycatDebate/tabbycat

View on GitHub

Showing 438 of 438 total issues

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

    def get_queryset(self, request):
        return super(TeamScoreByAdjAdmin, self).get_queryset(request).select_related(
            'ballot_submission__debate__round__tournament',
            'debate_adjudicator__adjudicator',
            'debate_team__team',
Severity: Minor
Found in tabbycat/results/admin.py and 1 other location - About 40 mins to fix
tabbycat/results/admin.py on lines 107..113

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 52.

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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, teams, bracket, room_rank, flags=[], team_flags={}):
Severity: Minor
Found in tabbycat/draw/generator/pairing.py - About 35 mins to fix

    Function build has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def build(self, debates, teams, side_histories_before, side_histories_now, standings):
    Severity: Minor
    Found in tabbycat/draw/tables.py - About 35 mins to fix

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

          def __init__(self, teams, bracket, room_rank, flags=[], team_flags={}):
      Severity: Minor
      Found in tabbycat/draw/generator/pairing.py - About 35 mins to fix

        Function add_debate_adjudicators_column has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def add_debate_adjudicators_column(self, debates, title="Adjudicators",
        Severity: Minor
        Found in tabbycat/utils/tables.py - About 35 mins to fix

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

              def __init__(self, teams, bracket, room_rank, flags=[], team_flags={}):
          Severity: Minor
          Found in tabbycat/draw/generator/pairing.py - About 35 mins to fix

            Function receive_debate_change has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def receive_debate_change(self, content, key, content_name, field_name, serializer):
            Severity: Minor
            Found in tabbycat/draw/consumers.py - About 35 mins to fix

              Function add_team_ballots has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def add_team_ballots(self, side_tag, result, adj, scoresheet, side):
              Severity: Minor
              Found in tabbycat/importer/archive.py - About 35 mins to fix

                Function liveness has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def liveness(self, team, teams_count, prelims, current_round):
                Severity: Minor
                Found in tabbycat/breakqual/utils.py - About 35 mins to fix

                  Function construct_info has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def construct_info(self, venue, source, source_p, target, target_p):
                  Severity: Minor
                  Found in tabbycat/printing/views.py - About 35 mins to fix

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

                        def __init__(self, ballotsub, tabroom, password=False, *args, **kwargs):
                    Severity: Minor
                    Found in tabbycat/results/forms.py - About 35 mins to fix

                      Function build has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def build(self, draw, teams, side_histories_before, side_histories_now, standings):
                      Severity: Minor
                      Found in tabbycat/draw/tables.py - About 35 mins to fix

                        Function compile_grouped_gender_counts has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def compile_grouped_gender_counts(titles, queryset, gender_field, group_field, group_values):
                        Severity: Minor
                        Found in tabbycat/standings/diversity.py - About 35 mins to fix

                          Function compile_grouped_means_by_gender has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def compile_grouped_means_by_gender(titles, queryset, gender_field, group_field, group_values):
                          Severity: Minor
                          Found in tabbycat/standings/diversity.py - About 35 mins to fix

                            Function record_added_metric has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def record_added_metric(self, key, name, abbr, icon, ascending):
                            Severity: Minor
                            Found in tabbycat/standings/base.py - About 35 mins to fix

                              Function handle_object has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def handle_object(self, obj, name_field, delete_func, add_func, **options):
                              Severity: Minor
                              Found in tabbycat/adjfeedback/management/commands/generatefeedback.py - About 35 mins to fix

                                Function compile_grouped_counts has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def compile_grouped_counts(title, queryset, group_field, group_values, group_labels):
                                Severity: Minor
                                Found in tabbycat/standings/diversity.py - About 35 mins to fix

                                  Function add_team_round_results has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  def add_team_round_results(standings, rounds, opponents=False, lookup=None, id_attr='instance_id'):
                                  Severity: Minor
                                  Found in tabbycat/standings/round_results.py - About 35 mins to fix

                                    Function get_response_dict has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def get_response_dict(self, request, obj, checked, event, **kwargs):
                                    Severity: Minor
                                    Found in tabbycat/api/views.py - About 35 mins to fix

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

                                          def __init__(self, container, chair=None, panellists=None, trainees=None, from_db=False):
                                      Severity: Minor
                                      Found in tabbycat/adjallocation/allocation.py - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language