twitterdev/twitter-python-ads-sdk

View on GitHub

Showing 77 of 77 total issues

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

    @classmethod
    def languages(klass, account, **kwargs):
        """Returns a list of supported languages"""
        resource = klass.RESOURCE_OPTIONS + 'languages'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 46..51
twitter_ads/campaign.py on lines 53..58
twitter_ads/campaign.py on lines 60..65
twitter_ads/campaign.py on lines 67..72
twitter_ads/campaign.py on lines 74..79
twitter_ads/campaign.py on lines 88..93
twitter_ads/campaign.py on lines 95..100
twitter_ads/campaign.py on lines 102..107
twitter_ads/campaign.py on lines 109..114
twitter_ads/campaign.py on lines 116..121
twitter_ads/campaign.py on lines 123..128

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

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

    @classmethod
    def behaviors(klass, account, **kwargs):
        """Returns a list of supported behaviors"""
        resource = klass.RESOURCE_OPTIONS + 'behaviors'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 53..58
twitter_ads/campaign.py on lines 60..65
twitter_ads/campaign.py on lines 67..72
twitter_ads/campaign.py on lines 74..79
twitter_ads/campaign.py on lines 81..86
twitter_ads/campaign.py on lines 88..93
twitter_ads/campaign.py on lines 95..100
twitter_ads/campaign.py on lines 102..107
twitter_ads/campaign.py on lines 109..114
twitter_ads/campaign.py on lines 116..121
twitter_ads/campaign.py on lines 123..128

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

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

    @classmethod
    def events(klass, account, **kwargs):
        """Returns a list of supported events"""
        resource = klass.RESOURCE_OPTIONS + 'events'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 46..51
twitter_ads/campaign.py on lines 53..58
twitter_ads/campaign.py on lines 60..65
twitter_ads/campaign.py on lines 74..79
twitter_ads/campaign.py on lines 81..86
twitter_ads/campaign.py on lines 88..93
twitter_ads/campaign.py on lines 95..100
twitter_ads/campaign.py on lines 102..107
twitter_ads/campaign.py on lines 109..114
twitter_ads/campaign.py on lines 116..121
twitter_ads/campaign.py on lines 123..128

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

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

    @classmethod
    def conversations(klass, account, **kwargs):
        """Returns a list of supported conversations"""
        resource = klass.RESOURCE_OPTIONS + 'conversations'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 46..51
twitter_ads/campaign.py on lines 60..65
twitter_ads/campaign.py on lines 67..72
twitter_ads/campaign.py on lines 74..79
twitter_ads/campaign.py on lines 81..86
twitter_ads/campaign.py on lines 88..93
twitter_ads/campaign.py on lines 95..100
twitter_ads/campaign.py on lines 102..107
twitter_ads/campaign.py on lines 109..114
twitter_ads/campaign.py on lines 116..121
twitter_ads/campaign.py on lines 123..128

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

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

    responses.add(responses.GET,
                  with_resource('/' + API_VERSION + '/accounts/2iqph/campaigns'),
                  body=with_fixture('campaigns_all'),
                  content_type='application/json',
                  headers={
Severity: Major
Found in tests/test_rate_limit.py and 1 other location - About 2 hrs to fix
tests/test_rate_limit.py on lines 299..306

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

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

    @classmethod
    def locations(klass, account, **kwargs):
        """Returns a list of supported locations"""
        resource = klass.RESOURCE_OPTIONS + 'locations'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 46..51
twitter_ads/campaign.py on lines 53..58
twitter_ads/campaign.py on lines 60..65
twitter_ads/campaign.py on lines 67..72
twitter_ads/campaign.py on lines 74..79
twitter_ads/campaign.py on lines 81..86
twitter_ads/campaign.py on lines 95..100
twitter_ads/campaign.py on lines 102..107
twitter_ads/campaign.py on lines 109..114
twitter_ads/campaign.py on lines 116..121
twitter_ads/campaign.py on lines 123..128

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

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

    @classmethod
    def interests(klass, account, **kwargs):
        """Returns a list of supported interests"""
        resource = klass.RESOURCE_OPTIONS + 'interests'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 46..51
twitter_ads/campaign.py on lines 53..58
twitter_ads/campaign.py on lines 60..65
twitter_ads/campaign.py on lines 67..72
twitter_ads/campaign.py on lines 81..86
twitter_ads/campaign.py on lines 88..93
twitter_ads/campaign.py on lines 95..100
twitter_ads/campaign.py on lines 102..107
twitter_ads/campaign.py on lines 109..114
twitter_ads/campaign.py on lines 116..121
twitter_ads/campaign.py on lines 123..128

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

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

    @classmethod
    def tv_shows(klass, account, **kwargs):
        """Returns a list of supported TV shows"""
        resource = klass.RESOURCE_OPTIONS + 'tv_shows'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 46..51
twitter_ads/campaign.py on lines 53..58
twitter_ads/campaign.py on lines 60..65
twitter_ads/campaign.py on lines 67..72
twitter_ads/campaign.py on lines 74..79
twitter_ads/campaign.py on lines 81..86
twitter_ads/campaign.py on lines 88..93
twitter_ads/campaign.py on lines 95..100
twitter_ads/campaign.py on lines 102..107
twitter_ads/campaign.py on lines 109..114
twitter_ads/campaign.py on lines 116..121

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

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 sandbox():
        """Enables and disables sandbox mode."""
        def fget(self):
            return self._options.get('sandbox', None)

Severity: Major
Found in twitter_ads/client.py and 1 other location - About 2 hrs to fix
twitter_ads/client.py on lines 83..91

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

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

    @classmethod
    def platform_versions(klass, account, **kwargs):
        """Returns a list of supported platform versions"""
        resource = klass.RESOURCE_OPTIONS + 'platform_versions'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 46..51
twitter_ads/campaign.py on lines 53..58
twitter_ads/campaign.py on lines 60..65
twitter_ads/campaign.py on lines 67..72
twitter_ads/campaign.py on lines 74..79
twitter_ads/campaign.py on lines 81..86
twitter_ads/campaign.py on lines 88..93
twitter_ads/campaign.py on lines 95..100
twitter_ads/campaign.py on lines 102..107
twitter_ads/campaign.py on lines 116..121
twitter_ads/campaign.py on lines 123..128

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

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

    @classmethod
    def devices(klass, account, **kwargs):
        """Returns a list of supported devices"""
        resource = klass.RESOURCE_OPTIONS + 'devices'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 46..51
twitter_ads/campaign.py on lines 53..58
twitter_ads/campaign.py on lines 67..72
twitter_ads/campaign.py on lines 74..79
twitter_ads/campaign.py on lines 81..86
twitter_ads/campaign.py on lines 88..93
twitter_ads/campaign.py on lines 95..100
twitter_ads/campaign.py on lines 102..107
twitter_ads/campaign.py on lines 109..114
twitter_ads/campaign.py on lines 116..121
twitter_ads/campaign.py on lines 123..128

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

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 trace():
        """Enables and disables request tracing."""
        def fget(self):
            return self._options.get('trace', None)

Severity: Major
Found in twitter_ads/client.py and 1 other location - About 2 hrs to fix
twitter_ads/client.py on lines 71..79

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

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

    @classmethod
    def network_operators(klass, account, **kwargs):
        """Returns a list of supported network operators"""
        resource = klass.RESOURCE_OPTIONS + 'network_operators'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 46..51
twitter_ads/campaign.py on lines 53..58
twitter_ads/campaign.py on lines 60..65
twitter_ads/campaign.py on lines 67..72
twitter_ads/campaign.py on lines 74..79
twitter_ads/campaign.py on lines 81..86
twitter_ads/campaign.py on lines 88..93
twitter_ads/campaign.py on lines 102..107
twitter_ads/campaign.py on lines 109..114
twitter_ads/campaign.py on lines 116..121
twitter_ads/campaign.py on lines 123..128

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

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

    @classmethod
    def platforms(klass, account, **kwargs):
        """Returns a list of supported platforms"""
        resource = klass.RESOURCE_OPTIONS + 'platforms'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 46..51
twitter_ads/campaign.py on lines 53..58
twitter_ads/campaign.py on lines 60..65
twitter_ads/campaign.py on lines 67..72
twitter_ads/campaign.py on lines 74..79
twitter_ads/campaign.py on lines 81..86
twitter_ads/campaign.py on lines 88..93
twitter_ads/campaign.py on lines 95..100
twitter_ads/campaign.py on lines 109..114
twitter_ads/campaign.py on lines 116..121
twitter_ads/campaign.py on lines 123..128

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

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

    @classmethod
    def tv_markets(klass, account, **kwargs):
        """Returns a list of supported TV markets"""
        resource = klass.RESOURCE_OPTIONS + 'tv_markets'
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/campaign.py and 13 other locations - About 2 hrs to fix
twitter_ads/campaign.py on lines 32..37
twitter_ads/campaign.py on lines 39..44
twitter_ads/campaign.py on lines 46..51
twitter_ads/campaign.py on lines 53..58
twitter_ads/campaign.py on lines 60..65
twitter_ads/campaign.py on lines 67..72
twitter_ads/campaign.py on lines 74..79
twitter_ads/campaign.py on lines 81..86
twitter_ads/campaign.py on lines 88..93
twitter_ads/campaign.py on lines 95..100
twitter_ads/campaign.py on lines 102..107
twitter_ads/campaign.py on lines 109..114
twitter_ads/campaign.py on lines 123..128

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

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

    @classmethod
    @FlattenParams
    def load(klass, account, **kwargs):
        resource = klass.RESOURCE_COLLECTION.format(account_id=account.id)
        request = Request(account.client, 'get', resource, params=kwargs)
Severity: Major
Found in twitter_ads/creative.py and 1 other location - About 1 hr to fix
twitter_ads/creative.py on lines 366..369

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

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

        if kwargs.get('card_uris'):
            resource = klass.FETCH_URI.format(account_id=account.id)
            request = Request(account.client, 'get', resource, params=kwargs)
            return Cursor(klass, request, init_with=[account])
Severity: Major
Found in twitter_ads/creative.py and 1 other location - About 1 hr to fix
twitter_ads/creative.py on lines 445..450

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

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

card.components= [
        {
          "media_key": "13_794652834998325248",
          "media_metadata": {
            "13_794652834998325248": {
Severity: Major
Found in examples/cards.py and 1 other location - About 1 hr to fix
examples/cards.py on lines 56..77

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

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

class MediaCreative(Analytics, Resource, Persistence):

    PROPERTIES = {}

    RESOURCE_COLLECTION = '/' + API_VERSION + '/accounts/{account_id}/media_creatives'
Severity: Major
Found in twitter_ads/creative.py and 2 other locations - About 1 hr to fix
twitter_ads/campaign.py on lines 148..153
twitter_ads/creative.py on lines 16..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 45.

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

class FundingInstrument(Analytics, Resource, Persistence):

    PROPERTIES = {}

    RESOURCE_COLLECTION = '/' + API_VERSION + '/accounts/{account_id}/funding_instruments'
Severity: Major
Found in twitter_ads/campaign.py and 2 other locations - About 1 hr to fix
twitter_ads/creative.py on lines 16..21
twitter_ads/creative.py on lines 106..111

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

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