saltstack/salt

View on GitHub
salt/modules/osquery.py

Summary

Maintainability
F
1 wk
Test Coverage

File osquery.py has 724 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Support for OSQuery - https://osquery.io.

.. versionadded:: 2015.8.0
Severity: Major
Found in salt/modules/osquery.py - About 1 day to fix

    Function _osquery_cmd has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    def _osquery_cmd(table, attrs=None, where=None, format='json'):
        '''
        Helper function to run osquery queries
        '''
        ret = {
    Severity: Minor
    Found in salt/modules/osquery.py - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Avoid deeply nested control flow statements.
    Open

                        if a not in valid_attrs:
                            ret['result'] = False
                            ret['comment'] = '{0} is not a valid attribute for table {1}'.format(a, table)
                            return ret
                    _attrs = ','.join(attrs)
    Severity: Major
    Found in salt/modules/osquery.py - About 45 mins to fix

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

      def kernel_modules(attrs=None, where=None):
          '''
          Return kernel_modules information from osquery
      
          CLI Example:
      Severity: Major
      Found in salt/modules/osquery.py and 4 other locations - About 1 hr to fix
      salt/modules/osquery.py on lines 149..161
      salt/modules/osquery.py on lines 179..191
      salt/modules/osquery.py on lines 194..206
      salt/modules/osquery.py on lines 209..221

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

      def kernel_integrity(attrs=None, where=None):
          '''
          Return kernel_integrity information from osquery
      
          CLI Example:
      Severity: Major
      Found in salt/modules/osquery.py and 4 other locations - About 1 hr to fix
      salt/modules/osquery.py on lines 164..176
      salt/modules/osquery.py on lines 179..191
      salt/modules/osquery.py on lines 194..206
      salt/modules/osquery.py on lines 209..221

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

      def process_memory_map(attrs=None, where=None):
          '''
          Return process_memory_map information from osquery
      
          CLI Example:
      Severity: Major
      Found in salt/modules/osquery.py and 4 other locations - About 1 hr to fix
      salt/modules/osquery.py on lines 149..161
      salt/modules/osquery.py on lines 164..176
      salt/modules/osquery.py on lines 179..191
      salt/modules/osquery.py on lines 209..221

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

      def memory_map(attrs=None, where=None):
          '''
          Return memory_map information from osquery
      
          CLI Example:
      Severity: Major
      Found in salt/modules/osquery.py and 4 other locations - About 1 hr to fix
      salt/modules/osquery.py on lines 149..161
      salt/modules/osquery.py on lines 164..176
      salt/modules/osquery.py on lines 194..206
      salt/modules/osquery.py on lines 209..221

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

      def shared_memory(attrs=None, where=None):
          '''
          Return shared_memory information from osquery
      
          CLI Example:
      Severity: Major
      Found in salt/modules/osquery.py and 4 other locations - About 1 hr to fix
      salt/modules/osquery.py on lines 149..161
      salt/modules/osquery.py on lines 164..176
      salt/modules/osquery.py on lines 179..191
      salt/modules/osquery.py on lines 194..206

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

      def apt_sources(attrs=None, where=None):
          '''
          Return apt_sources information from osquery
      
          CLI Example:
      Severity: Major
      Found in salt/modules/osquery.py and 2 other locations - About 1 hr to fix
      salt/modules/osquery.py on lines 133..146
      salt/modules/osquery.py on lines 239..251

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

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

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

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

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

      Refactorings

      Further Reading

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

      def rpm_packages(attrs=None, where=None):
          '''
          Return cpuid information from osquery
      
          CLI Example:
      Severity: Major
      Found in salt/modules/osquery.py and 2 other locations - About 1 hr to fix
      salt/modules/osquery.py on lines 224..236
      salt/modules/osquery.py on lines 239..251

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

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

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

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

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

      Refactorings

      Further Reading

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

      def deb_packages(attrs=None, where=None):
          '''
          Return deb_packages information from osquery
      
          CLI Example:
      Severity: Major
      Found in salt/modules/osquery.py and 2 other locations - About 1 hr to fix
      salt/modules/osquery.py on lines 133..146
      salt/modules/osquery.py on lines 224..236

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

      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 alf_explicit_auths(attrs=None, where=None):
          '''
          Return alf_explicit_auths 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 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 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 safari_extensions(attrs=None, where=None):
          '''
          Return safari_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 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 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 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 preferences(attrs=None, where=None):
          '''
          Return preferences 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 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 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 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 homebrew_packages(attrs=None, where=None):
          '''
          Return homebrew_packages 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 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 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 alf_services(attrs=None, where=None):
          '''
          Return alf_services 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 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 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 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 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 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 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 chrome_extensions(attrs=None, where=None):
          '''
          Return chrome_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 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 keychain_items(attrs=None, where=None):
          '''
          Return keychain_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 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 xattr_where_from(attrs=None, where=None):
          '''
          Return xattr_where_from 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 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 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

      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

      There are no issues that match your filters.

      Category
      Status