kiwitcms/Kiwi

View on GitHub

Showing 1,585 of 1,695 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

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

          def test_user_can_view_their_own_profile(self):
              logged_in = self.client.login(  # nosec:B106:hardcoded_password_funcarg
                  username=self.tester.username,
                  password='password')
              self.assertTrue(logged_in)
      Severity: Major
      Found in tcms/kiwi_auth/test_profiles.py and 1 other location - About 1 day to fix
      tcms/kiwi_auth/test_profiles.py on lines 35..47

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

      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 test_user_case_view_profile_of_another_user(self):
              logged_in = self.client.login(  # nosec:B106:hardcoded_password_funcarg
                  username=self.tester.username,
                  password='password')
              self.assertTrue(logged_in)
      Severity: Major
      Found in tcms/kiwi_auth/test_profiles.py and 1 other location - About 1 day to fix
      tcms/kiwi_auth/test_profiles.py on lines 21..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 125.

      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 506 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 414 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 5 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

                      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 136..141

              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

                      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 144..152

              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:: XML-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 136..161

              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:: XML-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 301..327

              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),
                      '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 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 113..130
              tcms/testplans/views.py on lines 152..168

              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 113..130
              tcms/testplans/views.py on lines 133..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 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 133..149
              tcms/testplans/views.py on lines 152..168

              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

              function populateProductVersion() {
                  let href = $('#add_id_version')[0].href;
                  $('#add_id_version')[0].href = href.slice(0, href.indexOf('&product'));
                  $('#add_id_version')[0].href += `&product=${$('#id_product').val()}`;
              
              
              Severity: Major
              Found in tcms/testplans/static/testplans/js/mutable.js and 1 other location - About 4 hrs to fix
              tcms/testcases/static/testcases/js/mutable.js on lines 27..35

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

              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