twitterdev/twitter-python-ads-sdk

View on GitHub
twitter_ads/campaign.py

Summary

Maintainability
F
5 days
Test Coverage

File campaign.py has 354 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (C) 2015 Twitter, Inc.

"""Container for all campaign management logic used by the Ads API SDK."""

from twitter_ads.enum import TRANSFORM
Severity: Minor
Found in twitter_ads/campaign.py - About 4 hrs to fix

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

        @classmethod
        @FlattenParams
        def all(klass, account, **kwargs):
            """Returns a Cursor instance for a given resource."""
            resource = klass.RESOURCE_COLLECTION.format(account_id=account.id)
    Severity: Major
    Found in twitter_ads/campaign.py and 2 other locations - About 2 hrs to fix
    twitter_ads/analytics.py on lines 96..105
    twitter_ads/creative.py on lines 64..72

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

    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 app_store_categories(klass, account, **kwargs):
            """Returns a list of supported app store categories"""
            resource = klass.RESOURCE_OPTIONS + 'app_store_categories'
            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 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
    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 behavior_taxonomies(klass, account, **kwargs):
            """Returns a list of supported behavior taxonomies"""
            resource = klass.RESOURCE_OPTIONS + 'behavior_taxonomies'
            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 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
    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 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 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 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 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 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

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

    class TrackingTags(Resource, Persistence):
    
        PROPERTIES = {}
    
        RESOURCE_COLLECTION = '/' + API_VERSION + '/accounts/{account_id}/tracking_tags'
    Severity: Major
    Found in twitter_ads/campaign.py and 8 other locations - About 1 hr to fix
    twitter_ads/campaign.py on lines 308..313
    twitter_ads/campaign.py on lines 335..340
    twitter_ads/creative.py on lines 87..92
    twitter_ads/creative.py on lines 129..134
    twitter_ads/creative.py on lines 163..168
    twitter_ads/creative.py on lines 201..206
    twitter_ads/creative.py on lines 227..232
    twitter_ads/creative.py on lines 308..313

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

    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

    class ScheduledPromotedTweet(Resource, Persistence):
    
        PROPERTIES = {}
    
        RESOURCE_COLLECTION = '/' + API_VERSION + '/accounts/{account_id}/scheduled_promoted_tweets'
    Severity: Major
    Found in twitter_ads/campaign.py and 8 other locations - About 1 hr to fix
    twitter_ads/campaign.py on lines 308..313
    twitter_ads/campaign.py on lines 355..360
    twitter_ads/creative.py on lines 87..92
    twitter_ads/creative.py on lines 129..134
    twitter_ads/creative.py on lines 163..168
    twitter_ads/creative.py on lines 201..206
    twitter_ads/creative.py on lines 227..232
    twitter_ads/creative.py on lines 308..313

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

    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

    class LineItemApps(Resource, Persistence):
    
        PROPERTIES = {}
    
        RESOURCE_COLLECTION = '/' + API_VERSION + '/accounts/{account_id}/line_item_apps'
    Severity: Major
    Found in twitter_ads/campaign.py and 8 other locations - About 1 hr to fix
    twitter_ads/campaign.py on lines 335..340
    twitter_ads/campaign.py on lines 355..360
    twitter_ads/creative.py on lines 87..92
    twitter_ads/creative.py on lines 129..134
    twitter_ads/creative.py on lines 163..168
    twitter_ads/creative.py on lines 201..206
    twitter_ads/creative.py on lines 227..232
    twitter_ads/creative.py on lines 308..313

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

    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