KAMI911/osm_poi_matchmaker

View on GitHub

Showing 109 of 335 total issues

Function generate_osm_xml has a Cognitive Complexity of 205 (exceeds 5 allowed). Consider refactoring.
Open

def generate_osm_xml(df, session=None):
    """Crete OpenStreetMap (OSM XML) file from passed Panda Dataframe

    Args:
        df ([type]): [description]
Severity: Minor
Found in osm_poi_matchmaker/libs/file_output.py - About 4 days 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

POIDataset has 174 functions (exceeds 20 allowed). Consider refactoring.
Open

class POIDataset:
    """Contains all handled OSM tags
    """    
    def __init__(self):
        """
Severity: Major
Found in osm_poi_matchmaker/libs/poi_dataset.py - About 3 days to fix

    Function process has a Cognitive Complexity of 149 (exceeds 5 allowed). Consider refactoring.
    Open

        def process(self):
            try:
                soup = save_downloaded_soup('{}'.format(self.link), os.path.join(self.download_cache, self.filename),
                                            self.filetype)
                if soup is not None:
    Severity: Minor
    Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py - About 3 days 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 process has a Cognitive Complexity of 147 (exceeds 5 allowed). Consider refactoring.
    Open

        def process(self):
            try:
                soup = save_downloaded_soup('{}'.format(self.link), os.path.join(self.download_cache, self.filename),
                                            self.filetype)
                for e in soup.findAll('post'):
    Severity: Minor
    Found in osm_poi_matchmaker/dataproviders/hu_posta.py - About 2 days 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 online_poi_matching has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
    Open

    def online_poi_matching(args):
        data, comm_data = args
        try:
            db = POIBase('{}://{}:{}@{}:{}/{}'.format(config.get_database_type(), config.get_database_writer_username(),
                                                      config.get_database_writer_password(),
    Severity: Minor
    Found in osm_poi_matchmaker/libs/online_poi_matching.py - About 2 days 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 poi_dataset.py has 757 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    __author__ = 'kami911'
    
    try:
        import logging
    Severity: Major
    Found in osm_poi_matchmaker/libs/poi_dataset.py - About 1 day to fix

      File poi_base.py has 606 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      try:
          import logging
          import sys
          import geopandas as gpd
      Severity: Major
      Found in osm_poi_matchmaker/dao/poi_base.py - About 1 day to fix

        Function process has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
        Open

            def process(self):
                try:
                    soup = save_downloaded_soup('{}'.format(self.link), os.path.join(self.download_cache, self.filename),
                                                self.filetype)
                    if soup is not None:
        Severity: Minor
        Found in osm_poi_matchmaker/dataproviders/hu_avia.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 address.py has 460 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        
        try:
            import logging
            import sys
        Severity: Minor
        Found in osm_poi_matchmaker/libs/address.py - About 7 hrs to fix

          Function process has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
          Open

              def process(self):
                  try:
                      soup = save_downloaded_soup('{}'.format(self.link), os.path.join(self.download_cache, self.filename),
                                                  self.filetype)
                      if soup is not None:
          Severity: Minor
          Found in osm_poi_matchmaker/dataproviders/hu_tesco.py - About 6 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 process has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

              def process(self):
                  try:
                      soup = save_downloaded_soup('{}'.format(self.link), os.path.join(self.download_cache, self.filename),
                                                  self.filetype)
                      if soup is not None:
          Severity: Minor
          Found in osm_poi_matchmaker/dataproviders/hu_sber_bank.py - About 5 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 query_osm_shop_poi_gpd has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

              def query_osm_shop_poi_gpd(self, lon: float, lat: float, ptype: str = 'shop', name: str = '', avoid_name: str = '', street_name: str = '',
                                         housenumber: str = '', conscriptionnumber: str = '', city: str = '',
                                         distance_perfect: int = None, distance_safe: int = None, distance_unsafe: int = None,
                                         with_metadata: bool = True):
                  '''
          Severity: Minor
          Found in osm_poi_matchmaker/dao/poi_base.py - About 5 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 process has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

              def process(self):
                  try:
                      if self.link:
                          # soup = save_downloaded_soup('{}'.format(self.link), os.path.join(self.download_cache,
                          #                            self.filename), self.post, self.verify_link, headers=self.headers)
          Severity: Minor
          Found in osm_poi_matchmaker/dataproviders/hu_kulcs_patika.py - About 5 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 process has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
          Open

              def process(self):
                  oh = ''
                  oh_list = []
                  for k, v in self.df_dup.iterrows():
                      if v['open'] is not None and v['close'] is not None:
          Severity: Minor
          Found in osm_poi_matchmaker/libs/opening_hours.py - About 5 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 save_downloaded_soup has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def save_downloaded_soup(link, file, filetype, post_data=None, verify=config.get_download_verify_link(), headers=None):
              if config.get_download_use_cached_data() is True and os.path.isfile(file):
                  soup = readfile(file, filetype)
              else:
                  if link is not None:
          Severity: Minor
          Found in osm_poi_matchmaker/libs/soup.py - About 5 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 file_output.py has 371 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          
          try:
              import logging
              import sys
          Severity: Minor
          Found in osm_poi_matchmaker/libs/file_output.py - About 4 hrs to fix

            Function process has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                def process(self):
                    try:
                        csv = save_downloaded_pd('{}'.format(self.link), os.path.join(
                            self.download_cache, self.filename))
                        if csv is not None:
            Severity: Minor
            Found in osm_poi_matchmaker/dataproviders/hu_shell.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 process has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                def process(self):
                    try:
                        soup = save_downloaded_soup('{}'.format(self.link), os.path.join(self.download_cache, self.filename),
                                                    self.filetype, self.post)
                        if soup is not None:
            Severity: Minor
            Found in osm_poi_matchmaker/dataproviders/hu_omv.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 process has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                def process(self):
                    try:
                        soup = save_downloaded_soup('{}'.format(self.link), os.path.join(self.download_cache, self.filename),
                                                    self.filetype)
                        if soup is not None:
            Severity: Minor
            Found in osm_poi_matchmaker/dataproviders/hu_dm.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 process has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

                def process(self):
                    try:
                        soup = save_downloaded_soup('{}'.format(self.link), os.path.join(self.download_cache, self.filename),
                                                    self.filetype)
                        if soup is not None:
            Severity: Minor
            Found in osm_poi_matchmaker/dataproviders/hu_oil.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

            Severity
            Category
            Status
            Source
            Language