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',
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, teams, bracket, room_rank, flags=[], team_flags={}):
Function build
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def build(self, debates, teams, side_histories_before, side_histories_now, standings):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, teams, bracket, room_rank, flags=[], team_flags={}):
Function add_debate_adjudicators_column
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_debate_adjudicators_column(self, debates, title="Adjudicators",
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, teams, bracket, room_rank, flags=[], team_flags={}):
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):
Function add_team_ballots
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_team_ballots(self, side_tag, result, adj, scoresheet, side):
Function liveness
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def liveness(self, team, teams_count, prelims, current_round):
Function construct_info
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def construct_info(self, venue, source, source_p, target, target_p):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, ballotsub, tabroom, password=False, *args, **kwargs):
Function build
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def build(self, draw, teams, side_histories_before, side_histories_now, standings):
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):
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):
Function record_added_metric
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def record_added_metric(self, key, name, abbr, icon, ascending):
Function handle_object
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle_object(self, obj, name_field, delete_func, add_func, **options):
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):
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'):
Function get_response_dict
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_response_dict(self, request, obj, checked, event, **kwargs):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, container, chair=None, panellists=None, trainees=None, from_db=False):