saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

        if callback is not None:
            def handle_future(future):
                response = future.result()
                self.io_loop.add_callback(callback, response)
            future.add_done_callback(handle_future)
Severity: Major
Found in salt/crypt.py and 3 other locations - About 1 hr to fix
salt/transport/ipc.py on lines 287..291
salt/transport/tcp.py on lines 1176..1180
salt/transport/zeromq.py on lines 1273..1277

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

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

    if route_table_name:
        route_table_id = _get_resource_id('route_table', route_table_name,
                                          region=region, key=key,
                                          keyid=keyid, profile=profile)
        if not route_table_id:
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_vpc.py on lines 1843..1849
salt/modules/boto_vpc.py on lines 1850..1856
salt/modules/boto_vpc.py on lines 1894..1900
salt/modules/boto_vpc.py on lines 2207..2213
salt/modules/boto_vpc.py on lines 2322..2328
salt/modules/boto_vpc.py on lines 2330..2336
salt/modules/boto_vpc.py on lines 2338..2344
salt/modules/boto_vpc.py on lines 2403..2410
salt/modules/boto_vpc.py on lines 2444..2450

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

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

        if internet_gateway_name:
            gateway_id = _get_resource_id('internet_gateway', internet_gateway_name,
                                          region=region, key=key,
                                          keyid=keyid, profile=profile)
            if not gateway_id:
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_vpc.py on lines 1843..1849
salt/modules/boto_vpc.py on lines 1850..1856
salt/modules/boto_vpc.py on lines 1894..1900
salt/modules/boto_vpc.py on lines 2207..2213
salt/modules/boto_vpc.py on lines 2218..2224
salt/modules/boto_vpc.py on lines 2322..2328
salt/modules/boto_vpc.py on lines 2338..2344
salt/modules/boto_vpc.py on lines 2403..2410
salt/modules/boto_vpc.py on lines 2444..2450

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

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

def pool_start(name, **kwargs):
    '''
    Start a defined libvirt storage pool.

    :param name: libvirt storage pool name
Severity: Major
Found in salt/modules/virt.py and 7 other locations - About 1 hr to fix
salt/modules/virt.py on lines 4807..4829
salt/modules/virt.py on lines 4832..4854
salt/modules/virt.py on lines 4857..4879
salt/modules/virt.py on lines 5186..5208
salt/modules/virt.py on lines 5211..5233
salt/modules/virt.py on lines 5236..5258
salt/modules/virt.py on lines 5291..5313

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

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

def pool_undefine(name, **kwargs):
    '''
    Remove a defined libvirt storage pool. The pool needs to be stopped before calling.

    :param name: libvirt storage pool name
Severity: Major
Found in salt/modules/virt.py and 7 other locations - About 1 hr to fix
salt/modules/virt.py on lines 4807..4829
salt/modules/virt.py on lines 4832..4854
salt/modules/virt.py on lines 4857..4879
salt/modules/virt.py on lines 5161..5183
salt/modules/virt.py on lines 5186..5208
salt/modules/virt.py on lines 5211..5233
salt/modules/virt.py on lines 5291..5313

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

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

    if network_acl_name:
        network_acl_id = _get_resource_id('network_acl', network_acl_name,
                                          region=region, key=key,
                                          keyid=keyid, profile=profile)
        if not network_acl_id:
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_vpc.py on lines 1850..1856
salt/modules/boto_vpc.py on lines 1894..1900
salt/modules/boto_vpc.py on lines 2207..2213
salt/modules/boto_vpc.py on lines 2218..2224
salt/modules/boto_vpc.py on lines 2322..2328
salt/modules/boto_vpc.py on lines 2330..2336
salt/modules/boto_vpc.py on lines 2338..2344
salt/modules/boto_vpc.py on lines 2403..2410
salt/modules/boto_vpc.py on lines 2444..2450

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

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

        if route_table_name:
            route_table_id = _get_resource_id('route_table', route_table_name,
                                              region=region, key=key,
                                              keyid=keyid, profile=profile)
            if not route_table_id:
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_vpc.py on lines 1843..1849
salt/modules/boto_vpc.py on lines 1850..1856
salt/modules/boto_vpc.py on lines 1894..1900
salt/modules/boto_vpc.py on lines 2207..2213
salt/modules/boto_vpc.py on lines 2218..2224
salt/modules/boto_vpc.py on lines 2330..2336
salt/modules/boto_vpc.py on lines 2338..2344
salt/modules/boto_vpc.py on lines 2403..2410
salt/modules/boto_vpc.py on lines 2444..2450

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

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

        if vpc_peering_connection_name:
            vpc_peering_connection_id = _get_resource_id('vpc_peering_connection', vpc_peering_connection_name,
                                                         region=region, key=key,
                                                         keyid=keyid, profile=profile)
            if not vpc_peering_connection_id:
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_vpc.py on lines 1843..1849
salt/modules/boto_vpc.py on lines 1850..1856
salt/modules/boto_vpc.py on lines 1894..1900
salt/modules/boto_vpc.py on lines 2207..2213
salt/modules/boto_vpc.py on lines 2218..2224
salt/modules/boto_vpc.py on lines 2322..2328
salt/modules/boto_vpc.py on lines 2330..2336
salt/modules/boto_vpc.py on lines 2403..2410
salt/modules/boto_vpc.py on lines 2444..2450

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

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

        if subnet_name:
            subnet_id = _get_resource_id('subnet', subnet_name,
                                         region=region, key=key,
                                         keyid=keyid, profile=profile)
            if not subnet_id:
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_vpc.py on lines 1843..1849
salt/modules/boto_vpc.py on lines 1850..1856
salt/modules/boto_vpc.py on lines 2207..2213
salt/modules/boto_vpc.py on lines 2218..2224
salt/modules/boto_vpc.py on lines 2322..2328
salt/modules/boto_vpc.py on lines 2330..2336
salt/modules/boto_vpc.py on lines 2338..2344
salt/modules/boto_vpc.py on lines 2403..2410
salt/modules/boto_vpc.py on lines 2444..2450

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

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

    if path not in __context__['semaphore_map']:
        __context__['semaphore_map'][path] = _Semaphore(zk, path, identifier,
Severity: Major
Found in salt/modules/zk_concurrency.py and 2 other locations - About 1 hr to fix
salt/modules/zk_concurrency.py on lines 246..247
salt/modules/zk_concurrency.py on lines 309..310

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

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

    if path not in __context__['semaphore_map']:
        __context__['semaphore_map'][path] = _Semaphore(zk, path, identifier,
Severity: Major
Found in salt/modules/zk_concurrency.py and 2 other locations - About 1 hr to fix
salt/modules/zk_concurrency.py on lines 194..195
salt/modules/zk_concurrency.py on lines 246..247

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

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

def pool_stop(name, **kwargs):
    '''
    Stop a defined libvirt storage pool.

    :param name: libvirt storage pool name
Severity: Major
Found in salt/modules/virt.py and 7 other locations - About 1 hr to fix
salt/modules/virt.py on lines 4807..4829
salt/modules/virt.py on lines 4832..4854
salt/modules/virt.py on lines 4857..4879
salt/modules/virt.py on lines 5161..5183
salt/modules/virt.py on lines 5186..5208
salt/modules/virt.py on lines 5236..5258
salt/modules/virt.py on lines 5291..5313

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

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

        if route_table_name:
            route_table_id = _get_resource_id('route_table', route_table_name,
                                              region=region, key=key,
                                              keyid=keyid, profile=profile)
            if not route_table_id:
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_vpc.py on lines 1843..1849
salt/modules/boto_vpc.py on lines 1850..1856
salt/modules/boto_vpc.py on lines 1894..1900
salt/modules/boto_vpc.py on lines 2207..2213
salt/modules/boto_vpc.py on lines 2218..2224
salt/modules/boto_vpc.py on lines 2322..2328
salt/modules/boto_vpc.py on lines 2330..2336
salt/modules/boto_vpc.py on lines 2338..2344
salt/modules/boto_vpc.py on lines 2403..2410

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

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

def pool_refresh(name, **kwargs):
    '''
    Refresh a defined libvirt storage pool.

    :param name: libvirt storage pool name
Severity: Major
Found in salt/modules/virt.py and 7 other locations - About 1 hr to fix
salt/modules/virt.py on lines 4807..4829
salt/modules/virt.py on lines 4832..4854
salt/modules/virt.py on lines 4857..4879
salt/modules/virt.py on lines 5161..5183
salt/modules/virt.py on lines 5186..5208
salt/modules/virt.py on lines 5211..5233
salt/modules/virt.py on lines 5236..5258

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

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

    try:
        if route_table_name:
            route_table_id = _get_resource_id('route_table', route_table_name,
                                              region=region, key=key,
                                              keyid=keyid, profile=profile)
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_vpc.py on lines 1843..1849
salt/modules/boto_vpc.py on lines 1850..1856
salt/modules/boto_vpc.py on lines 1894..1900
salt/modules/boto_vpc.py on lines 2207..2213
salt/modules/boto_vpc.py on lines 2218..2224
salt/modules/boto_vpc.py on lines 2322..2328
salt/modules/boto_vpc.py on lines 2330..2336
salt/modules/boto_vpc.py on lines 2338..2344
salt/modules/boto_vpc.py on lines 2444..2450

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

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

    if path not in __context__['semaphore_map']:
        __context__['semaphore_map'][path] = _Semaphore(zk, path, identifier,
Severity: Major
Found in salt/modules/zk_concurrency.py and 2 other locations - About 1 hr to fix
salt/modules/zk_concurrency.py on lines 194..195
salt/modules/zk_concurrency.py on lines 309..310

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

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

    if subnet_name:
        subnet_id = _get_resource_id('subnet', subnet_name,
                                     region=region, key=key,
                                     keyid=keyid, profile=profile)
        if not subnet_id:
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_vpc.py on lines 1843..1849
salt/modules/boto_vpc.py on lines 1894..1900
salt/modules/boto_vpc.py on lines 2207..2213
salt/modules/boto_vpc.py on lines 2218..2224
salt/modules/boto_vpc.py on lines 2322..2328
salt/modules/boto_vpc.py on lines 2330..2336
salt/modules/boto_vpc.py on lines 2338..2344
salt/modules/boto_vpc.py on lines 2403..2410
salt/modules/boto_vpc.py on lines 2444..2450

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

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

def pool_build(name, **kwargs):
    '''
    Build a defined libvirt storage pool.

    :param name: libvirt storage pool name
Severity: Major
Found in salt/modules/virt.py and 7 other locations - About 1 hr to fix
salt/modules/virt.py on lines 4807..4829
salt/modules/virt.py on lines 4832..4854
salt/modules/virt.py on lines 4857..4879
salt/modules/virt.py on lines 5161..5183
salt/modules/virt.py on lines 5211..5233
salt/modules/virt.py on lines 5236..5258
salt/modules/virt.py on lines 5291..5313

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

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

    if subnet_name:
        subnet_id = _get_resource_id('subnet', subnet_name,
                                     region=region, key=key,
                                     keyid=keyid, profile=profile)
        if not subnet_id:
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_vpc.py on lines 1843..1849
salt/modules/boto_vpc.py on lines 1850..1856
salt/modules/boto_vpc.py on lines 1894..1900
salt/modules/boto_vpc.py on lines 2218..2224
salt/modules/boto_vpc.py on lines 2322..2328
salt/modules/boto_vpc.py on lines 2330..2336
salt/modules/boto_vpc.py on lines 2338..2344
salt/modules/boto_vpc.py on lines 2403..2410
salt/modules/boto_vpc.py on lines 2444..2450

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

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

def network_start(name, **kwargs):
    '''
    Start a defined virtual network.

    :param name: virtual network name
Severity: Major
Found in salt/modules/virt.py and 7 other locations - About 1 hr to fix
salt/modules/virt.py on lines 4832..4854
salt/modules/virt.py on lines 4857..4879
salt/modules/virt.py on lines 5161..5183
salt/modules/virt.py on lines 5186..5208
salt/modules/virt.py on lines 5211..5233
salt/modules/virt.py on lines 5236..5258
salt/modules/virt.py on lines 5291..5313

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

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