KAMI911/osm_poi_matchmaker

View on GitHub
osm_poi_matchmaker/dataproviders/hu_budapest_bank.py

Summary

Maintainability
F
1 wk
Test Coverage

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

Avoid deeply nested control flow statements.
Open

                            if 'H:' in i:
                                try:
                                    op = i.replace('H:', '').split(
                                        '-')[0].strip()
                                except IndexError as e:
Severity: Major
Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py - About 45 mins to fix

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

                                elif 'P:' in i:
                                    try:
                                        op = i.replace('P:', '').split(
                                            '-')[0].strip()
                                    except IndexError as e:
    Severity: Major
    Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py and 4 other locations - About 1 day to fix
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 84..96
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 97..109
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 110..122
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 123..135

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

    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 5 locations. Consider refactoring.
    Open

                                elif 'Sz:' in i:
                                    try:
                                        op = i.replace('Sz:', '').split(
                                            '-')[0].strip()
                                    except IndexError as e:
    Severity: Major
    Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py and 4 other locations - About 1 day to fix
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 84..96
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 97..109
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 123..135
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 136..148

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

    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 5 locations. Consider refactoring.
    Open

                                elif 'Cs:' in i:
                                    try:
                                        op = i.replace('Cs:', '').split(
                                            '-')[0].strip()
                                    except IndexError as e:
    Severity: Major
    Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py and 4 other locations - About 1 day to fix
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 84..96
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 97..109
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 110..122
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 136..148

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

    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 5 locations. Consider refactoring.
    Open

                                if 'H:' in i:
                                    try:
                                        op = i.replace('H:', '').split(
                                            '-')[0].strip()
                                    except IndexError as e:
    Severity: Major
    Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py and 4 other locations - About 1 day to fix
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 97..109
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 110..122
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 123..135
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 136..148

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

    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 5 locations. Consider refactoring.
    Open

                                elif 'K:' in i:
                                    try:
                                        op = i.replace('K:', '').split(
                                            '-')[0].strip()
                                    except IndexError as e:
    Severity: Major
    Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py and 4 other locations - About 1 day to fix
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 84..96
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 110..122
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 123..135
    osm_poi_matchmaker/dataproviders/hu_budapest_bank.py on lines 136..148

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

    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 constains(self):
            self.link = 'https://www.budapestbank.hu/info/fiokkereso/process/get_data.php?action=get_data_json'
            self.tags = {'brand': 'Budapest Bank', 'brand:wikidata': 'Q27493463', 'bic': 'BUDAHUHB',
                         'brand:wikipedia': 'en:Budapest Bank', 'operator': 'Budapest Bank Zrt.',
                         'operator:addr': '1138 Budapest, Váci út 193.', 'ref:vatin': 'HU10196445',
    Severity: Major
    Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py and 2 other locations - About 3 hrs to fix
    osm_poi_matchmaker/dataproviders/hu_obi.py on lines 24..33
    osm_poi_matchmaker/dataproviders/hu_takko.py on lines 24..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 73.

    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

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

    try:
        import logging
        import sys
        import json
        import os
    Severity: Major
    Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py and 1 other location - About 3 hrs to fix
    osm_poi_matchmaker/dataproviders/hu_sber_bank.py on lines 3..17

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

    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

            self.__types = [
                {'poi_code': 'hubpbank', 'poi_name': 'Budapest Bank', 'poi_type': 'bank',
                 'poi_tags': hubpbank, 'poi_url_base': 'https://www.budapestbank.hu',
                 'poi_search_name': '(budapest bank|bp bank)',
                 'poi_search_avoid_name': '(otpbank|otp|otp bank)',
    Severity: Major
    Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py and 1 other location - About 1 hr to fix
    osm_poi_matchmaker/dataproviders/hu_cib_bank.py on lines 42..52

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

    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

    Identical blocks of code found in 21 locations. Consider refactoring.
    Open

                soup = save_downloaded_soup('{}'.format(self.link), os.path.join(self.download_cache, self.filename),
                                            self.filetype)
    Severity: Major
    Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py and 20 other locations - About 40 mins to fix
    osm_poi_matchmaker/dataproviders/hu_aldi.py on lines 48..49
    osm_poi_matchmaker/dataproviders/hu_avia.py on lines 50..51
    osm_poi_matchmaker/dataproviders/hu_benu.py on lines 50..51
    osm_poi_matchmaker/dataproviders/hu_cba.py on lines 65..66
    osm_poi_matchmaker/dataproviders/hu_dm.py on lines 50..51
    osm_poi_matchmaker/dataproviders/hu_foxpost.py on lines 50..51
    osm_poi_matchmaker/dataproviders/hu_jysk.py on lines 49..50
    osm_poi_matchmaker/dataproviders/hu_mobil_petrol.py on lines 49..50
    osm_poi_matchmaker/dataproviders/hu_mol_bubi.py on lines 42..43
    osm_poi_matchmaker/dataproviders/hu_obi.py on lines 48..49
    osm_poi_matchmaker/dataproviders/hu_oil.py on lines 50..51
    osm_poi_matchmaker/dataproviders/hu_penny_market.py on lines 50..51
    osm_poi_matchmaker/dataproviders/hu_pepco.py on lines 50..51
    osm_poi_matchmaker/dataproviders/hu_posta.py on lines 73..74
    osm_poi_matchmaker/dataproviders/hu_posta_json.py on lines 71..72
    osm_poi_matchmaker/dataproviders/hu_sber_bank.py on lines 54..55
    osm_poi_matchmaker/dataproviders/hu_spar.py on lines 68..69
    osm_poi_matchmaker/dataproviders/hu_tesco.py on lines 81..82
    osm_poi_matchmaker/dataproviders/hu_tom_market.py on lines 45..46
    osm_poi_matchmaker/dataproviders/hu_yves_rocher.py on lines 52..53

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

    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 7 locations. Consider refactoring.
    Open

                        self.data.lat, self.data.lon = check_hu_boundary(
                            poi_data['latitude'], poi_data['longitude'])
    Severity: Major
    Found in osm_poi_matchmaker/dataproviders/hu_budapest_bank.py and 6 other locations - About 35 mins to fix
    osm_poi_matchmaker/dataproviders/hu_avia.py on lines 63..64
    osm_poi_matchmaker/dataproviders/hu_foxpost.py on lines 69..70
    osm_poi_matchmaker/dataproviders/hu_mol.py on lines 77..78
    osm_poi_matchmaker/dataproviders/hu_nemzetidohanybolt.py on lines 50..51
    osm_poi_matchmaker/dataproviders/hu_shell.py on lines 114..115
    osm_poi_matchmaker/dataproviders/hu_spar.py on lines 99..100

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

    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

    There are no issues that match your filters.

    Category
    Status