saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

    if cret:
        ret['comment'] = 'The user {0} has been {1}d'.format(name, mode)
        if update:
            ret['changes'][name] = update
        else:
Severity: Major
Found in salt/states/postgres_user.py and 1 other location - About 1 hr to fix
salt/states/postgres_group.py on lines 203..211

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

class SimpleParameter(Parameter):
    '''
    A Parameter is a SimpleParameter, if it's just a simple type, like a
    string.

Severity: Major
Found in salt/modules/syslog_ng.py and 1 other location - About 1 hr to fix
salt/modules/syslog_ng.py on lines 344..358

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        if isinstance(s, (bytes, bytearray)):
            for enc in encoding:
                try:
                    return _normalize(s.decode(enc, errors))
                except UnicodeDecodeError as err:
Severity: Major
Found in salt/utils/stringutils.py and 1 other location - About 1 hr to fix
salt/utils/stringutils.py on lines 148..160

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        if ( jQuery.isFunction( html ) ) {
            return this.each(function(i) {
                jQuery(this).wrapInner( html.call(this, i) );
            });
        }
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js and 1 other location - About 1 hr to fix
doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js on lines 5884..5888

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

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 ( jQuery.isFunction( html ) ) {
            return this.each(function(i) {
                jQuery(this).wrapAll( html.call(this, i) );
            });
        }
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js and 1 other location - About 1 hr to fix
doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js on lines 5913..5917

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

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

def firefox_addons(attrs=None, where=None):
    '''
    Return firefox_addons information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def xprotect_reports(attrs=None, where=None):
    '''
    Return xprotect_reports information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def nfs_shares(attrs=None, where=None):
    '''
    Return nfs_shares information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def nvram(attrs=None, where=None):
    '''
    Return nvram information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def iokit_registry(attrs=None, where=None):
    '''
    Return iokit_registry information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def startup_items(attrs=None, where=None):
    '''
    Return startup_items information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def iokit_devicetree(attrs=None, where=None):
    '''
    Return iokit_devicetree information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def alf_exceptions(attrs=None, where=None):
    '''
    Return alf_exceptions information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def quarantine(attrs=None, where=None):
    '''
    Return quarantine information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def kernel_extensions(attrs=None, where=None):
    '''
    Return kernel_extensions information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def xprotect_entries(attrs=None, where=None):
    '''
    Return xprotect_entries information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def apps(attrs=None, where=None):
    '''
    Return apps information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def certificates(attrs=None, where=None):
    '''
    Return certificates information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def alf(attrs=None, where=None):
    '''
    Return alf information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 852..864
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def launchd(attrs=None, where=None):
    '''
    Return launchd information from osquery

    CLI Example:
Severity: Major
Found in salt/modules/osquery.py and 22 other locations - About 1 hr to fix
salt/modules/osquery.py on lines 657..669
salt/modules/osquery.py on lines 672..684
salt/modules/osquery.py on lines 687..699
salt/modules/osquery.py on lines 702..714
salt/modules/osquery.py on lines 717..729
salt/modules/osquery.py on lines 732..744
salt/modules/osquery.py on lines 747..759
salt/modules/osquery.py on lines 762..774
salt/modules/osquery.py on lines 777..789
salt/modules/osquery.py on lines 792..804
salt/modules/osquery.py on lines 807..819
salt/modules/osquery.py on lines 822..834
salt/modules/osquery.py on lines 837..849
salt/modules/osquery.py on lines 867..879
salt/modules/osquery.py on lines 882..894
salt/modules/osquery.py on lines 897..909
salt/modules/osquery.py on lines 912..924
salt/modules/osquery.py on lines 927..939
salt/modules/osquery.py on lines 942..954
salt/modules/osquery.py on lines 957..969
salt/modules/osquery.py on lines 972..984
salt/modules/osquery.py on lines 987..999

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language