saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

    for name in stop:
        try:
            win32serviceutil.StopService(name)
        except pywintypes.error as exc:
            if exc.winerror != 1062:
Severity: Major
Found in salt/modules/win_service.py and 1 other location - About 7 hrs to fix
salt/modules/win_service.py on lines 641..653

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

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 isinstance(kwargs.get('inbound_nat_pools'), list):
        for idx in six_range(0, len(kwargs['inbound_nat_pools'])):
            # Link to sub-objects which might be created at the same time as the load balancer
            if 'frontend_ip_configuration' in kwargs['inbound_nat_pools'][idx]:
                kwargs['inbound_nat_pools'][idx]['frontend_ip_configuration'] = {
Severity: Major
Found in salt/modules/azurearm_network.py and 1 other location - About 7 hrs to fix
salt/modules/azurearm_network.py on lines 1250..1260

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

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

def tenants_list(**kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all tenants for your account.
Severity: Major
Found in salt/modules/azurearm_resource.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_compute.py on lines 512..537
salt/modules/azurearm_network.py on lines 637..662
salt/modules/azurearm_network.py on lines 853..877
salt/modules/azurearm_network.py on lines 1059..1083
salt/modules/azurearm_network.py on lines 1573..1597
salt/modules/azurearm_network.py on lines 1956..1980
salt/modules/azurearm_network.py on lines 2365..2389
salt/modules/azurearm_network.py on lines 2724..2748
salt/modules/azurearm_resource.py on lines 81..105
salt/modules/azurearm_resource.py on lines 781..805
salt/modules/azurearm_resource.py on lines 1012..1036

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

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

def load_balancers_list_all(**kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all load balancers within a subscription.
Severity: Major
Found in salt/modules/azurearm_network.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_compute.py on lines 512..537
salt/modules/azurearm_network.py on lines 637..662
salt/modules/azurearm_network.py on lines 853..877
salt/modules/azurearm_network.py on lines 1573..1597
salt/modules/azurearm_network.py on lines 1956..1980
salt/modules/azurearm_network.py on lines 2365..2389
salt/modules/azurearm_network.py on lines 2724..2748
salt/modules/azurearm_resource.py on lines 81..105
salt/modules/azurearm_resource.py on lines 781..805
salt/modules/azurearm_resource.py on lines 808..832
salt/modules/azurearm_resource.py on lines 1012..1036

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

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

def network_interfaces_list_all(**kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all network interfaces within a subscription.
Severity: Major
Found in salt/modules/azurearm_network.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_compute.py on lines 512..537
salt/modules/azurearm_network.py on lines 637..662
salt/modules/azurearm_network.py on lines 853..877
salt/modules/azurearm_network.py on lines 1059..1083
salt/modules/azurearm_network.py on lines 1956..1980
salt/modules/azurearm_network.py on lines 2365..2389
salt/modules/azurearm_network.py on lines 2724..2748
salt/modules/azurearm_resource.py on lines 81..105
salt/modules/azurearm_resource.py on lines 781..805
salt/modules/azurearm_resource.py on lines 808..832
salt/modules/azurearm_resource.py on lines 1012..1036

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

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

def network_security_groups_list_all(**kwargs):  # pylint: disable=invalid-name
    '''
    .. versionadded:: 2019.2.0

    List all network security groups within a subscription.
Severity: Major
Found in salt/modules/azurearm_network.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_compute.py on lines 512..537
salt/modules/azurearm_network.py on lines 853..877
salt/modules/azurearm_network.py on lines 1059..1083
salt/modules/azurearm_network.py on lines 1573..1597
salt/modules/azurearm_network.py on lines 1956..1980
salt/modules/azurearm_network.py on lines 2365..2389
salt/modules/azurearm_network.py on lines 2724..2748
salt/modules/azurearm_resource.py on lines 81..105
salt/modules/azurearm_resource.py on lines 781..805
salt/modules/azurearm_resource.py on lines 808..832
salt/modules/azurearm_resource.py on lines 1012..1036

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

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

def route_tables_list_all(**kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all route tables within a subscription.
Severity: Major
Found in salt/modules/azurearm_network.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_compute.py on lines 512..537
salt/modules/azurearm_network.py on lines 637..662
salt/modules/azurearm_network.py on lines 853..877
salt/modules/azurearm_network.py on lines 1059..1083
salt/modules/azurearm_network.py on lines 1573..1597
salt/modules/azurearm_network.py on lines 1956..1980
salt/modules/azurearm_network.py on lines 2365..2389
salt/modules/azurearm_resource.py on lines 81..105
salt/modules/azurearm_resource.py on lines 781..805
salt/modules/azurearm_resource.py on lines 808..832
salt/modules/azurearm_resource.py on lines 1012..1036

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

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

def virtual_machines_list_all(**kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all virtual machines within a subscription.
Severity: Major
Found in salt/modules/azurearm_compute.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_network.py on lines 637..662
salt/modules/azurearm_network.py on lines 853..877
salt/modules/azurearm_network.py on lines 1059..1083
salt/modules/azurearm_network.py on lines 1573..1597
salt/modules/azurearm_network.py on lines 1956..1980
salt/modules/azurearm_network.py on lines 2365..2389
salt/modules/azurearm_network.py on lines 2724..2748
salt/modules/azurearm_resource.py on lines 81..105
salt/modules/azurearm_resource.py on lines 781..805
salt/modules/azurearm_resource.py on lines 808..832
salt/modules/azurearm_resource.py on lines 1012..1036

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

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

def policy_assignments_list(**kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all policy assignments for a subscription.
Severity: Major
Found in salt/modules/azurearm_resource.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_compute.py on lines 512..537
salt/modules/azurearm_network.py on lines 637..662
salt/modules/azurearm_network.py on lines 853..877
salt/modules/azurearm_network.py on lines 1059..1083
salt/modules/azurearm_network.py on lines 1573..1597
salt/modules/azurearm_network.py on lines 1956..1980
salt/modules/azurearm_network.py on lines 2365..2389
salt/modules/azurearm_network.py on lines 2724..2748
salt/modules/azurearm_resource.py on lines 81..105
salt/modules/azurearm_resource.py on lines 781..805
salt/modules/azurearm_resource.py on lines 808..832

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

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

def public_ip_addresses_list_all(**kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all public IP addresses within a subscription.
Severity: Major
Found in salt/modules/azurearm_network.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_compute.py on lines 512..537
salt/modules/azurearm_network.py on lines 637..662
salt/modules/azurearm_network.py on lines 853..877
salt/modules/azurearm_network.py on lines 1059..1083
salt/modules/azurearm_network.py on lines 1573..1597
salt/modules/azurearm_network.py on lines 2365..2389
salt/modules/azurearm_network.py on lines 2724..2748
salt/modules/azurearm_resource.py on lines 81..105
salt/modules/azurearm_resource.py on lines 781..805
salt/modules/azurearm_resource.py on lines 808..832
salt/modules/azurearm_resource.py on lines 1012..1036

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

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

def resource_groups_list(**kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all resource groups within a subscription.
Severity: Major
Found in salt/modules/azurearm_resource.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_compute.py on lines 512..537
salt/modules/azurearm_network.py on lines 637..662
salt/modules/azurearm_network.py on lines 853..877
salt/modules/azurearm_network.py on lines 1059..1083
salt/modules/azurearm_network.py on lines 1573..1597
salt/modules/azurearm_network.py on lines 1956..1980
salt/modules/azurearm_network.py on lines 2365..2389
salt/modules/azurearm_network.py on lines 2724..2748
salt/modules/azurearm_resource.py on lines 781..805
salt/modules/azurearm_resource.py on lines 808..832
salt/modules/azurearm_resource.py on lines 1012..1036

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

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

def route_filters_list_all(**kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all route filters within a subscription.
Severity: Major
Found in salt/modules/azurearm_network.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_compute.py on lines 512..537
salt/modules/azurearm_network.py on lines 637..662
salt/modules/azurearm_network.py on lines 853..877
salt/modules/azurearm_network.py on lines 1059..1083
salt/modules/azurearm_network.py on lines 1573..1597
salt/modules/azurearm_network.py on lines 1956..1980
salt/modules/azurearm_network.py on lines 2724..2748
salt/modules/azurearm_resource.py on lines 81..105
salt/modules/azurearm_resource.py on lines 781..805
salt/modules/azurearm_resource.py on lines 808..832
salt/modules/azurearm_resource.py on lines 1012..1036

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

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

def virtual_networks_list_all(**kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all virtual networks within a subscription.
Severity: Major
Found in salt/modules/azurearm_network.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_compute.py on lines 512..537
salt/modules/azurearm_network.py on lines 637..662
salt/modules/azurearm_network.py on lines 1059..1083
salt/modules/azurearm_network.py on lines 1573..1597
salt/modules/azurearm_network.py on lines 1956..1980
salt/modules/azurearm_network.py on lines 2365..2389
salt/modules/azurearm_network.py on lines 2724..2748
salt/modules/azurearm_resource.py on lines 81..105
salt/modules/azurearm_resource.py on lines 781..805
salt/modules/azurearm_resource.py on lines 808..832
salt/modules/azurearm_resource.py on lines 1012..1036

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

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

def subscriptions_list(**kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all subscriptions for a tenant.
Severity: Major
Found in salt/modules/azurearm_resource.py and 11 other locations - About 7 hrs to fix
salt/modules/azurearm_compute.py on lines 512..537
salt/modules/azurearm_network.py on lines 637..662
salt/modules/azurearm_network.py on lines 853..877
salt/modules/azurearm_network.py on lines 1059..1083
salt/modules/azurearm_network.py on lines 1573..1597
salt/modules/azurearm_network.py on lines 1956..1980
salt/modules/azurearm_network.py on lines 2365..2389
salt/modules/azurearm_network.py on lines 2724..2748
salt/modules/azurearm_resource.py on lines 81..105
salt/modules/azurearm_resource.py on lines 808..832
salt/modules/azurearm_resource.py on lines 1012..1036

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

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

            if pkginfo is not None:
                # see rpm version string rules available at https://goo.gl/UGKPNd
                pkgver = pkginfo.version
                epoch = ''
                release = ''
Severity: Major
Found in salt/modules/yumpkg.py and 1 other location - About 7 hrs to fix
salt/modules/zypperpkg.py on lines 812..829

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

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

def _cleanup(obj):
    if obj:
        if isinstance(obj, dict):
            obj.pop('__', None)
            for k, v in six.iteritems(obj):
Severity: Major
Found in salt/pillar/stack.py and 1 other location - About 7 hrs to fix
salt/pillar/makostack.py on lines 504..512

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

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:
        device_info = storage_system.storageDeviceInfo
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
Severity: Major
Found in salt/utils/vmware.py and 1 other location - About 7 hrs to fix
salt/utils/vmware.py on lines 2636..2648

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

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

def avail_images(call=None):
    '''
    Return available OpenNebula images.

    CLI Example:
Severity: Major
Found in salt/cloud/clouds/opennebula.py and 3 other locations - About 7 hrs to fix
salt/cloud/clouds/opennebula.py on lines 346..371
salt/cloud/clouds/opennebula.py on lines 374..399
salt/cloud/clouds/opennebula.py on lines 402..427

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

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

                                        if req_val in reqs:
                                            if name in reqs[req_val]:
                                                if reqs[req_val][name] == state:
                                                    if reqs[req_val]['state'] == reqs[name][req_val]:
                                                        err = ('A recursive '
Severity: Major
Found in salt/state.py and 1 other location - About 7 hrs to fix
salt/state.py on lines 1319..1331

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

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

def _cleanup(obj):
    if obj:
        if isinstance(obj, dict):
            obj.pop('__', None)
            for k, v in six.iteritems(obj):
Severity: Major
Found in salt/pillar/makostack.py and 1 other location - About 7 hrs to fix
salt/pillar/stack.py on lines 466..475

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

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