KAMI911/osm_poi_matchmaker

View on GitHub
osm_poi_matchmaker/dataproviders/hu_jysk.py

Summary

Maintainability
C
1 day
Test Coverage

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

try:
    import logging
    import sys
    import os
    import re
Severity: Major
Found in osm_poi_matchmaker/dataproviders/hu_jysk.py and 1 other location - About 4 hrs to fix
osm_poi_matchmaker/dataproviders/hu_avia.py on lines 3..20

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

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 constains(self):
        self.link = 'https://jysk.hu/aruhazak'
        self.tags = {'shop': 'furniture', 'brand:wikidata': 'Q138913', 'brand:wikipedia': 'hu:JYSK',
                     'contact:facebook': 'https://www.facebook.com/JYSK.Magyarorszag/',
                     'operator:addr': '1103 Budapest, Sibrik Miklós út 30.', 'operator': 'JYSK Kft.',
Severity: Major
Found in osm_poi_matchmaker/dataproviders/hu_jysk.py and 1 other location - About 3 hrs to fix
osm_poi_matchmaker/dataproviders/hu_mobil_petrol.py on lines 26..34

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

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

    def types(self):
        hujyskfur = self.tags.copy()
        hujyskfur.update(POS_HU_GEN)
        hujyskfur.update(PAY_CASH)
        self.__types = [
Severity: Major
Found in osm_poi_matchmaker/dataproviders/hu_jysk.py and 8 other locations - About 3 hrs to fix
osm_poi_matchmaker/dataproviders/hu_dm.py on lines 36..46
osm_poi_matchmaker/dataproviders/hu_obi.py on lines 35..44
osm_poi_matchmaker/dataproviders/hu_oil.py on lines 36..46
osm_poi_matchmaker/dataproviders/hu_omv.py on lines 43..53
osm_poi_matchmaker/dataproviders/hu_penny_market.py on lines 37..46
osm_poi_matchmaker/dataproviders/hu_pepco.py on lines 36..46
osm_poi_matchmaker/dataproviders/hu_rossmann.py on lines 40..49
osm_poi_matchmaker/dataproviders/hu_yves_rocher.py on lines 37..48

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

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_jysk.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_budapest_bank.py on lines 57..58
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_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 9 locations. Consider refactoring.
Open

                    self.data.lat, self.data.lon = check_hu_boundary(
                        shop.get('lat'), shop.get('lon'))
Severity: Major
Found in osm_poi_matchmaker/dataproviders/hu_jysk.py and 8 other locations - About 35 mins to fix
osm_poi_matchmaker/dataproviders/hu_benu.py on lines 70..70
osm_poi_matchmaker/dataproviders/hu_cba.py on lines 88..89
osm_poi_matchmaker/dataproviders/hu_magnet_bank.py on lines 77..78
osm_poi_matchmaker/dataproviders/hu_oil.py on lines 62..63
osm_poi_matchmaker/dataproviders/hu_omv.py on lines 85..86
osm_poi_matchmaker/dataproviders/hu_tesco.py on lines 101..102
osm_poi_matchmaker/dataproviders/hu_tom_market.py on lines 62..63
osm_poi_matchmaker/dataproviders/hu_yves_rocher.py on lines 63..65

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