kiwitcms/Kiwi

View on GitHub

Showing 1,571 of 1,697 total issues

File testplan_actions.js has 936 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Nitrate.TestPlans = {};
Nitrate.TestPlans.Details = {};
Nitrate.TestPlans.SearchCase = {};

/*
Severity: Major
Found in tcms/static/js/testplan_actions.js - About 2 days to fix

    File testrun_actions.js has 653 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    Nitrate.TestRuns = {};
    Nitrate.TestRuns.Details = {};
    Nitrate.TestRuns.Execute = {}
    Nitrate.TestRuns.AssignCase = {}
    
    
    Severity: Major
    Found in tcms/static/js/testrun_actions.js - About 1 day to fix

      File views.py has 526 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      
      from django.conf import settings
      from django.contrib import messages
      from django.contrib.auth.decorators import permission_required
      Severity: Major
      Found in tcms/testcases/views.py - About 1 day to fix

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

        $(document).ready(() => {
            $('[data-toggle="tooltip"]').tooltip()
        
            loadInitialProduct();
            loadInitialTestPlans();
        tcms/telemetry/static/telemetry/js/testing/execution-trends.js on lines 1..21

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

        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

        $(document).ready(() => {
            $('[data-toggle="tooltip"]').tooltip()
        
            loadInitialProduct();
            loadInitialTestPlans();
        tcms/telemetry/static/telemetry/js/testing/test-case-health.js on lines 1..21

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

        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

        File views.py has 424 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        
        from django.conf import settings
        from django.contrib import messages
        from django.contrib.auth import get_user_model
        Severity: Minor
        Found in tcms/testruns/views.py - About 6 hrs to fix

          Function on_load has 142 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Nitrate.TestRuns.Details.on_load = function() {
            setAddTagAutocomplete();
          
            // Observe the interface buttons
            jQ('#id_check_all_button').bind('click', function(e) {
          Severity: Major
          Found in tcms/static/js/testrun_actions.js - About 5 hrs to fix

            File serializer.py has 383 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            
            from datetime import datetime, timedelta
            from itertools import groupby
            
            
            Severity: Minor
            Found in tcms/rpc/serializer.py - About 5 hrs to fix

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

                  values_fields_mapping = {
                      'id': ('id', do_nothing),
                      'create_date': ('create_date', datetime_to_str),
                      'extra_link': ('extra_link', do_nothing),
                      'is_active': ('is_active', do_nothing),
              Severity: Major
              Found in tcms/rpc/serializer.py and 1 other location - About 5 hrs to fix
              tcms/rpc/serializer.py on lines 422..439

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

              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

                  values_fields_mapping = {
                      'id': ('id', do_nothing),
                      'case_text_version': ('case_text_version', do_nothing),
                      'close_date': ('close_date', datetime_to_str),
                      'sortkey': ('sortkey', do_nothing),
              Severity: Major
              Found in tcms/rpc/serializer.py and 1 other location - About 5 hrs to fix
              tcms/rpc/serializer.py on lines 393..409

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

              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

              @permissions_required('testcases.change_testcase')
              @rpc_method(name='TestCase.update')
              def update(case_id, values):
                  """
                  .. function:: RPC TestCase.update(case_id, values)
              Severity: Major
              Found in tcms/rpc/api/testcase.py and 1 other location - About 5 hrs to fix
              tcms/rpc/api/testplan.py on lines 137..162

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

              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 query.get('author'):
                          queryset = queryset.filter(
                              Q(author__first_name__startswith=query['author']) |
                              Q(author__last_name__startswith=query['author']) |
                              Q(author__username__icontains=query['author']) |
              Severity: Major
              Found in tcms/testcases/models.py and 1 other location - About 5 hrs to fix
              tcms/testcases/models.py on lines 141..149

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

              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 query.get('default_tester'):
                          queryset = queryset.filter(
                              Q(default_tester__first_name__startswith=query[
                                  'default_tester']) |
                              Q(default_tester__last_name__startswith=query[
              Severity: Major
              Found in tcms/testcases/models.py and 1 other location - About 5 hrs to fix
              tcms/testcases/models.py on lines 133..138

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

              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

              @permissions_required('testplans.change_testplan')
              @rpc_method(name='TestPlan.update')
              def update(plan_id, values):
                  """
                  .. function:: RPC TestPlan.update(plan_id, values)
              Severity: Major
              Found in tcms/rpc/api/testplan.py and 1 other location - About 5 hrs to fix
              tcms/rpc/api/testcase.py on lines 306..332

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

              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

              def get_number_of_plans_runs(plan_ids):
                  """Get the number of runs related to each plan
              
                  :param plan_ids: a tuple or list of TestPlans' ids
                  :type plan_ids: list or tuple
              Severity: Major
              Found in tcms/testplans/views.py and 2 other locations - About 4 hrs to fix
              tcms/testplans/views.py on lines 118..135
              tcms/testplans/views.py on lines 157..173

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

              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

              def get_number_of_children_plans(plan_ids):
                  """Get the number of children plans related to each plan
              
                  :param plan_ids: a tuple or list of TestPlans' ids
                  :type plan_ids: list or tuple
              Severity: Major
              Found in tcms/testplans/views.py and 2 other locations - About 4 hrs to fix
              tcms/testplans/views.py on lines 118..135
              tcms/testplans/views.py on lines 138..154

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

              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

              def get_number_of_plans_cases(plan_ids):
                  """Get the number of cases related to each plan
              
                  :param plan_ids: a tuple or list of TestPlans' ids
                  :type plan_ids: list or tuple
              Severity: Major
              Found in tcms/testplans/views.py and 2 other locations - About 4 hrs to fix
              tcms/testplans/views.py on lines 138..154
              tcms/testplans/views.py on lines 157..173

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

              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

              def backward_rename_permissions(apps, schema_editor):
                  permission_model = apps.get_model('auth', 'Permission')
              
                  for permission in permission_model.objects.filter(codename__contains='testexecution'):
                      old_name = permission.name.replace('test execution', 'test case run')
              tcms/testruns/migrations/0006_rename_test_case_run_to_test_execution.py on lines 7..16

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

              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

              def rename_permissions(apps, schema_editor):
                  permission_model = apps.get_model('auth', 'Permission')
              
                  for permission in permission_model.objects.filter(codename__contains='testcaserun'):
                      new_name = permission.name.replace('test case run', 'test execution')
              tcms/testruns/migrations/0006_rename_test_case_run_to_test_execution.py on lines 19..28

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

              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

              File testcase.py has 368 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              
              from django.forms import EmailField, ValidationError
              from django.forms.models import model_to_dict
              from modernrpc.core import REQUEST_KEY, rpc_method
              Severity: Minor
              Found in tcms/rpc/api/testcase.py - About 4 hrs to fix
                Severity
                Category
                Status
                Source
                Language