MetaPhase-Consulting/State-TalentMAP-API

View on GitHub

Showing 98 of 864 total issues

File agenda.py has 1062 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import csv
import logging
from functools import partial
from urllib.parse import urlencode, quote
from datetime import datetime
Severity: Major
Found in talentmap_api/fsbid/services/agenda.py - About 2 days to fix

    File common.py has 906 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import re
    import logging
    import csv
    from datetime import datetime
    from copy import deepcopy
    Severity: Major
    Found in talentmap_api/fsbid/services/common.py - About 2 days to fix

      Function modify_agenda has a Cognitive Complexity of 96 (exceeds 7 allowed). Consider refactoring.
      Open

      def modify_agenda(query={}, jwt_token=None, host=None):
          '''
          Create/Edit Agenda
          '''
          ai_validation = ai_validator.validate_agenda_item(query)
      Severity: Minor
      Found in talentmap_api/fsbid/services/agenda.py - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      File common_helpers.py has 590 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import datetime
      import logging
      import re
      import json
      import threading
      Severity: Major
      Found in talentmap_api/common/common_helpers.py - About 1 day to fix

        File client.py has 558 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import csv
        import logging
        from copy import deepcopy
        from datetime import datetime
        from urllib.parse import urlencode, quote
        Severity: Major
        Found in talentmap_api/fsbid/services/client.py - About 1 day to fix

          File assignment_cycles.py has 498 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          from datetime import datetime as dt
          from functools import partial
          import logging
          from talentmap_api.fsbid.services import common as services
          from talentmap_api.common.common_helpers import service_response
          Severity: Minor
          Found in talentmap_api/fsbid/services/assignment_cycles.py - About 7 hrs to fix

            File positions.py has 447 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import logging
            from urllib.parse import urlencode, quote
            
            import pydash
            from django.conf import settings
            Severity: Minor
            Found in talentmap_api/fsbid/services/positions.py - About 6 hrs to fix

              File settings.py has 436 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """
              Django settings for talentmap_api project.
              
              Generated by 'django-admin startproject' using Django 1.11.2.
              
              
              Severity: Minor
              Found in talentmap_api/settings.py - About 6 hrs to fix

                File available_positions.py has 399 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import logging
                from functools import partial
                
                import pydash
                from django.conf import settings
                Severity: Minor
                Found in talentmap_api/fsbid/services/available_positions.py - About 5 hrs to fix

                  File bureau.py has 377 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import logging
                  from urllib.parse import urlencode, quote
                  from functools import partial
                  from copy import deepcopy
                  
                  
                  Severity: Minor
                  Found in talentmap_api/fsbid/services/bureau.py - About 5 hrs to fix

                    File admin_projected_vacancies.py has 366 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import logging
                    import requests  # pylint: disable=unused-import
                    from talentmap_api.fsbid.services import common as services
                    from talentmap_api.common.common_helpers import service_response
                    
                    
                    Severity: Minor
                    Found in talentmap_api/fsbid/services/admin_projected_vacancies.py - About 4 hrs to fix

                      Function get_available_bidders_stats has a Cognitive Complexity of 34 (exceeds 7 allowed). Consider refactoring.
                      Open

                      def get_available_bidders_stats(data):
                          '''
                          Returns all Available Bidders statistics
                          '''
                          stats = {
                      Severity: Minor
                      Found in talentmap_api/cdo/services/available_bidders.py - About 4 hrs to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Consider simplifying this complex logical expression.
                      Open

                          if type(assignmentsCopy) is type([]):
                              for x in assignmentsCopy:
                                  pos = pydash.get(x, 'position[0]') or {}
                                  loc = pydash.get(pos, 'location[0]') or {}
                                  tmap_assignments.append(
                      Severity: Critical
                      Found in talentmap_api/fsbid/services/assignment_history.py - About 4 hrs to fix

                        File admin_panel.py has 358 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import logging
                        from functools import partial
                        
                        import pydash
                        import jwt
                        Severity: Minor
                        Found in talentmap_api/fsbid/services/admin_panel.py - About 4 hrs to fix

                          Function el_postions_req_mapping has a Cognitive Complexity of 32 (exceeds 7 allowed). Consider refactoring.
                          Open

                          def el_postions_req_mapping(request):
                              result = {
                                  'PV_API_VERSION_I': '',
                                  'PV_AD_ID_I': '',
                              }
                          Severity: Minor
                          Found in talentmap_api/fsbid/services/positions.py - About 4 hrs to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function parse_agenda_remarks has a Cognitive Complexity of 30 (exceeds 7 allowed). Consider refactoring.
                          Open

                          def parse_agenda_remarks(remarks=[]):
                              remarks_values = []
                              if remarks:
                                  for remark in remarks:
                                      remark['remarkRefData'][0]['airaiseqnum'] = remark.get('airaiseqnum')
                          Severity: Minor
                          Found in talentmap_api/fsbid/services/common.py - About 4 hrs to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          File available_position.py has 336 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import logging
                          import coreapi
                          import pydash
                          
                          from django.core.exceptions import PermissionDenied, SuspiciousOperation
                          Severity: Minor
                          Found in talentmap_api/available_positions/views/available_position.py - About 4 hrs to fix

                            Function get_ap_and_pv_csv has a Cognitive Complexity of 29 (exceeds 7 allowed). Consider refactoring.
                            Open

                            def get_ap_and_pv_csv(data, filename, ap=False, tandem=False):
                                response = HttpResponse(content_type='text/csv')
                                response['Content-Disposition'] = f"attachment; filename={filename}_{datetime.now().strftime('%Y_%m_%d_%H%M%S')}.csv"
                            
                                writer = csv.writer(response, csv.excel)
                            Severity: Minor
                            Found in talentmap_api/fsbid/services/common.py - About 3 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function modify_panel_meeting_and_dates has a Cognitive Complexity of 28 (exceeds 7 allowed). Consider refactoring.
                            Open

                            def modify_panel_meeting_and_dates(query, jwt_token):
                                '''
                                Modify Panel Meeting and Panel Meeting Dates
                                '''
                                # Inject decoded hru
                            Severity: Minor
                            Found in talentmap_api/fsbid/services/admin_panel.py - About 3 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function create_models_from_csv has a Cognitive Complexity of 27 (exceeds 7 allowed). Consider refactoring.
                            Open

                                def create_models_from_csv(self, csv_filepath):
                                    '''
                                    Loads data from an CSV file into a model, using a defined mapping of fields
                                    to CSV column titles.
                            
                            
                            Severity: Minor
                            Found in talentmap_api/common/xml_helpers.py - About 3 hrs to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Severity
                            Category
                            Status
                            Source
                            Language