saltstack/salt

View on GitHub
salt/modules/random_org.py

Summary

Maintainability
F
2 wks
Test Coverage

File random_org.py has 612 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Module for retrieving random information from Random.org

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

    Function generateIntegers has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    def generateIntegers(api_key=None,
                         api_version=None,
                         **kwargs):
        '''
        Generate random integers
    Severity: Minor
    Found in salt/modules/random_org.py - About 3 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

    Function generateBlobs has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def generateBlobs(api_key=None,
                      api_version=None,
                      **kwargs):
        '''
        List all Slack users.
    Severity: Minor
    Found in salt/modules/random_org.py - About 3 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

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

    def generateStrings(api_key=None,
                        api_version=None,
                        **kwargs):
        '''
        Generate random strings.
    Severity: Minor
    Found in salt/modules/random_org.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

    Function generateDecimalFractions has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def generateDecimalFractions(api_key=None,
                                 api_version=None,
                                 **kwargs):
        '''
        Generates true random decimal fractions
    Severity: Minor
    Found in salt/modules/random_org.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

    Function generateGaussians has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def generateGaussians(api_key=None,
                          api_version=None,
                          **kwargs):
        '''
        This method generates true random numbers from a
    Severity: Minor
    Found in salt/modules/random_org.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

    Function generateUUIDs has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def generateUUIDs(api_key=None,
                      api_version=None,
                      **kwargs):
        '''
        Generate a list of random UUIDs
    Severity: Minor
    Found in salt/modules/random_org.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

    Function getUsage has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def getUsage(api_key=None, api_version=None):
        '''
        Show current usages statistics
    
        :param api_key: The Random.org api key.
    Severity: Minor
    Found in salt/modules/random_org.py - About 1 hr 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

    Function _query has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def _query(api_version=None, data=None):
        '''
        Slack object method function to construct and execute on the API URL.
    
        :param api_key:     The Random.org api key.
    Severity: Minor
    Found in salt/modules/random_org.py - About 1 hr 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 too many return statements within this function.
    Open

            return ret
    Severity: Major
    Found in salt/modules/random_org.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return ret
      Severity: Major
      Found in salt/modules/random_org.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return ret
        Severity: Major
        Found in salt/modules/random_org.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return ret
          Severity: Major
          Found in salt/modules/random_org.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return ret
            Severity: Major
            Found in salt/modules/random_org.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return ret
              Severity: Major
              Found in salt/modules/random_org.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return ret
                Severity: Major
                Found in salt/modules/random_org.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return ret
                  Severity: Major
                  Found in salt/modules/random_org.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return ret
                    Severity: Major
                    Found in salt/modules/random_org.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return ret
                      Severity: Major
                      Found in salt/modules/random_org.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return ret
                        Severity: Major
                        Found in salt/modules/random_org.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return ret
                          Severity: Major
                          Found in salt/modules/random_org.py - About 30 mins to fix

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

                                if not api_key or not api_version:
                                    try:
                                        options = __salt__['config.option']('random_org')
                                        if not api_key:
                                            api_key = options.get('api_key')
                            Severity: Major
                            Found in salt/modules/random_org.py and 6 other locations - About 7 hrs to fix
                            salt/modules/random_org.py on lines 144..155
                            salt/modules/random_org.py on lines 218..229
                            salt/modules/random_org.py on lines 333..344
                            salt/modules/random_org.py on lines 422..433
                            salt/modules/random_org.py on lines 504..515
                            salt/modules/random_org.py on lines 686..697

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not api_key or not api_version:
                                    try:
                                        options = __salt__['config.option']('random_org')
                                        if not api_key:
                                            api_key = options.get('api_key')
                            Severity: Major
                            Found in salt/modules/random_org.py and 6 other locations - About 7 hrs to fix
                            salt/modules/random_org.py on lines 144..155
                            salt/modules/random_org.py on lines 218..229
                            salt/modules/random_org.py on lines 422..433
                            salt/modules/random_org.py on lines 504..515
                            salt/modules/random_org.py on lines 595..606
                            salt/modules/random_org.py on lines 686..697

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not api_key or not api_version:
                                    try:
                                        options = __salt__['config.option']('random_org')
                                        if not api_key:
                                            api_key = options.get('api_key')
                            Severity: Major
                            Found in salt/modules/random_org.py and 6 other locations - About 7 hrs to fix
                            salt/modules/random_org.py on lines 144..155
                            salt/modules/random_org.py on lines 218..229
                            salt/modules/random_org.py on lines 333..344
                            salt/modules/random_org.py on lines 504..515
                            salt/modules/random_org.py on lines 595..606
                            salt/modules/random_org.py on lines 686..697

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not api_key or not api_version:
                                    try:
                                        options = __salt__['config.option']('random_org')
                                        if not api_key:
                                            api_key = options.get('api_key')
                            Severity: Major
                            Found in salt/modules/random_org.py and 6 other locations - About 7 hrs to fix
                            salt/modules/random_org.py on lines 144..155
                            salt/modules/random_org.py on lines 218..229
                            salt/modules/random_org.py on lines 333..344
                            salt/modules/random_org.py on lines 422..433
                            salt/modules/random_org.py on lines 595..606
                            salt/modules/random_org.py on lines 686..697

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not api_key or not api_version:
                                    try:
                                        options = __salt__['config.option']('random_org')
                                        if not api_key:
                                            api_key = options.get('api_key')
                            Severity: Major
                            Found in salt/modules/random_org.py and 6 other locations - About 7 hrs to fix
                            salt/modules/random_org.py on lines 218..229
                            salt/modules/random_org.py on lines 333..344
                            salt/modules/random_org.py on lines 422..433
                            salt/modules/random_org.py on lines 504..515
                            salt/modules/random_org.py on lines 595..606
                            salt/modules/random_org.py on lines 686..697

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not api_key or not api_version:
                                    try:
                                        options = __salt__['config.option']('random_org')
                                        if not api_key:
                                            api_key = options.get('api_key')
                            Severity: Major
                            Found in salt/modules/random_org.py and 6 other locations - About 7 hrs to fix
                            salt/modules/random_org.py on lines 144..155
                            salt/modules/random_org.py on lines 333..344
                            salt/modules/random_org.py on lines 422..433
                            salt/modules/random_org.py on lines 504..515
                            salt/modules/random_org.py on lines 595..606
                            salt/modules/random_org.py on lines 686..697

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not api_key or not api_version:
                                    try:
                                        options = __salt__['config.option']('random_org')
                                        if not api_key:
                                            api_key = options.get('api_key')
                            Severity: Major
                            Found in salt/modules/random_org.py and 6 other locations - About 7 hrs to fix
                            salt/modules/random_org.py on lines 144..155
                            salt/modules/random_org.py on lines 218..229
                            salt/modules/random_org.py on lines 333..344
                            salt/modules/random_org.py on lines 422..433
                            salt/modules/random_org.py on lines 504..515
                            salt/modules/random_org.py on lines 595..606

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if result:
                                    if 'random' in result:
                                        random_data = result.get('random').get('data')
                                        ret['data'] = random_data
                                    else:
                            Severity: Major
                            Found in salt/modules/random_org.py and 5 other locations - About 6 hrs to fix
                            salt/modules/random_org.py on lines 284..293
                            salt/modules/random_org.py on lines 388..397
                            salt/modules/random_org.py on lines 459..468
                            salt/modules/random_org.py on lines 553..562
                            salt/modules/random_org.py on lines 740..749

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if result:
                                    if 'random' in result:
                                        random_data = result.get('random').get('data')
                                        ret['data'] = random_data
                                    else:
                            Severity: Major
                            Found in salt/modules/random_org.py and 5 other locations - About 6 hrs to fix
                            salt/modules/random_org.py on lines 284..293
                            salt/modules/random_org.py on lines 388..397
                            salt/modules/random_org.py on lines 459..468
                            salt/modules/random_org.py on lines 553..562
                            salt/modules/random_org.py on lines 650..659

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if result:
                                    if 'random' in result:
                                        random_data = result.get('random').get('data')
                                        ret['data'] = random_data
                                    else:
                            Severity: Major
                            Found in salt/modules/random_org.py and 5 other locations - About 6 hrs to fix
                            salt/modules/random_org.py on lines 284..293
                            salt/modules/random_org.py on lines 459..468
                            salt/modules/random_org.py on lines 553..562
                            salt/modules/random_org.py on lines 650..659
                            salt/modules/random_org.py on lines 740..749

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if result:
                                    if 'random' in result:
                                        random_data = result.get('random').get('data')
                                        ret['data'] = random_data
                                    else:
                            Severity: Major
                            Found in salt/modules/random_org.py and 5 other locations - About 6 hrs to fix
                            salt/modules/random_org.py on lines 284..293
                            salt/modules/random_org.py on lines 388..397
                            salt/modules/random_org.py on lines 459..468
                            salt/modules/random_org.py on lines 650..659
                            salt/modules/random_org.py on lines 740..749

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if result:
                                    if 'random' in result:
                                        random_data = result.get('random').get('data')
                                        ret['data'] = random_data
                                    else:
                            Severity: Major
                            Found in salt/modules/random_org.py and 5 other locations - About 6 hrs to fix
                            salt/modules/random_org.py on lines 284..293
                            salt/modules/random_org.py on lines 388..397
                            salt/modules/random_org.py on lines 553..562
                            salt/modules/random_org.py on lines 650..659
                            salt/modules/random_org.py on lines 740..749

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if result:
                                    if 'random' in result:
                                        random_data = result.get('random').get('data')
                                        ret['data'] = random_data
                                    else:
                            Severity: Major
                            Found in salt/modules/random_org.py and 5 other locations - About 6 hrs to fix
                            salt/modules/random_org.py on lines 388..397
                            salt/modules/random_org.py on lines 459..468
                            salt/modules/random_org.py on lines 553..562
                            salt/modules/random_org.py on lines 650..659
                            salt/modules/random_org.py on lines 740..749

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['number']) or not 1 <= kwargs['number'] <= 100:
                                    ret['res'] = False
                                    ret['message'] = 'Number of blobs must be between 1 and 100'
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 237..240
                            salt/modules/random_org.py on lines 242..245
                            salt/modules/random_org.py on lines 247..250
                            salt/modules/random_org.py on lines 352..355
                            salt/modules/random_org.py on lines 357..360
                            salt/modules/random_org.py on lines 444..447
                            salt/modules/random_org.py on lines 528..531
                            salt/modules/random_org.py on lines 614..617
                            salt/modules/random_org.py on lines 619..622
                            salt/modules/random_org.py on lines 624..627
                            salt/modules/random_org.py on lines 629..632

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['minimum']) or not -1000000000 <= kwargs['minimum'] <= 1000000000:
                                    ret['res'] = False
                                    ret['message'] = 'Minimum argument must be between -1,000,000,000 and 1,000,000,000'
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 237..240
                            salt/modules/random_org.py on lines 247..250
                            salt/modules/random_org.py on lines 352..355
                            salt/modules/random_org.py on lines 357..360
                            salt/modules/random_org.py on lines 444..447
                            salt/modules/random_org.py on lines 528..531
                            salt/modules/random_org.py on lines 614..617
                            salt/modules/random_org.py on lines 619..622
                            salt/modules/random_org.py on lines 624..627
                            salt/modules/random_org.py on lines 629..632
                            salt/modules/random_org.py on lines 705..708

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['length']) or not 1 <= kwargs['length'] <= 20:
                                    ret['res'] = False
                                    ret['message'] = 'Length of strings must be between 1 and 20'
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 237..240
                            salt/modules/random_org.py on lines 242..245
                            salt/modules/random_org.py on lines 247..250
                            salt/modules/random_org.py on lines 352..355
                            salt/modules/random_org.py on lines 444..447
                            salt/modules/random_org.py on lines 528..531
                            salt/modules/random_org.py on lines 614..617
                            salt/modules/random_org.py on lines 619..622
                            salt/modules/random_org.py on lines 624..627
                            salt/modules/random_org.py on lines 629..632
                            salt/modules/random_org.py on lines 705..708

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['number']) or not 1 <= kwargs['number'] <= 10000:
                                    ret['res'] = False
                                    ret['message'] = 'Number of strings must be between 1 and 10000'
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 237..240
                            salt/modules/random_org.py on lines 242..245
                            salt/modules/random_org.py on lines 247..250
                            salt/modules/random_org.py on lines 357..360
                            salt/modules/random_org.py on lines 444..447
                            salt/modules/random_org.py on lines 528..531
                            salt/modules/random_org.py on lines 614..617
                            salt/modules/random_org.py on lines 619..622
                            salt/modules/random_org.py on lines 624..627
                            salt/modules/random_org.py on lines 629..632
                            salt/modules/random_org.py on lines 705..708

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['number']) or not 1 <= kwargs['number'] <= 10000:
                                    ret['res'] = False
                                    ret['message'] = 'Number of integers must be between 1 and 10000'
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 242..245
                            salt/modules/random_org.py on lines 247..250
                            salt/modules/random_org.py on lines 352..355
                            salt/modules/random_org.py on lines 357..360
                            salt/modules/random_org.py on lines 444..447
                            salt/modules/random_org.py on lines 528..531
                            salt/modules/random_org.py on lines 614..617
                            salt/modules/random_org.py on lines 619..622
                            salt/modules/random_org.py on lines 624..627
                            salt/modules/random_org.py on lines 629..632
                            salt/modules/random_org.py on lines 705..708

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['number']) or not 1 <= kwargs['number'] <= 10000:
                                    ret['res'] = False
                                    ret['message'] = 'Number of decimal fractions must be between 1 and 10000'
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 237..240
                            salt/modules/random_org.py on lines 242..245
                            salt/modules/random_org.py on lines 247..250
                            salt/modules/random_org.py on lines 352..355
                            salt/modules/random_org.py on lines 357..360
                            salt/modules/random_org.py on lines 444..447
                            salt/modules/random_org.py on lines 528..531
                            salt/modules/random_org.py on lines 619..622
                            salt/modules/random_org.py on lines 624..627
                            salt/modules/random_org.py on lines 629..632
                            salt/modules/random_org.py on lines 705..708

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['number']) or not 1 <= kwargs['number'] <= 1000:
                                    ret['res'] = False
                                    ret['message'] = 'Number of UUIDs must be between 1 and 1000'
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 237..240
                            salt/modules/random_org.py on lines 242..245
                            salt/modules/random_org.py on lines 247..250
                            salt/modules/random_org.py on lines 352..355
                            salt/modules/random_org.py on lines 357..360
                            salt/modules/random_org.py on lines 528..531
                            salt/modules/random_org.py on lines 614..617
                            salt/modules/random_org.py on lines 619..622
                            salt/modules/random_org.py on lines 624..627
                            salt/modules/random_org.py on lines 629..632
                            salt/modules/random_org.py on lines 705..708

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['mean']) or not -1000000 <= kwargs['mean'] <= 1000000:
                                    ret['res'] = False
                                    ret['message'] = "The distribution's mean must be between -1000000 and 1000000"
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 237..240
                            salt/modules/random_org.py on lines 242..245
                            salt/modules/random_org.py on lines 247..250
                            salt/modules/random_org.py on lines 352..355
                            salt/modules/random_org.py on lines 357..360
                            salt/modules/random_org.py on lines 444..447
                            salt/modules/random_org.py on lines 528..531
                            salt/modules/random_org.py on lines 614..617
                            salt/modules/random_org.py on lines 624..627
                            salt/modules/random_org.py on lines 629..632
                            salt/modules/random_org.py on lines 705..708

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['standardDeviation']) or not -1000000 <= kwargs['standardDeviation'] <= 1000000:
                                    ret['res'] = False
                                    ret['message'] = "The distribution's standard deviation must be between -1000000 and 1000000"
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 237..240
                            salt/modules/random_org.py on lines 242..245
                            salt/modules/random_org.py on lines 247..250
                            salt/modules/random_org.py on lines 352..355
                            salt/modules/random_org.py on lines 357..360
                            salt/modules/random_org.py on lines 444..447
                            salt/modules/random_org.py on lines 528..531
                            salt/modules/random_org.py on lines 614..617
                            salt/modules/random_org.py on lines 619..622
                            salt/modules/random_org.py on lines 629..632
                            salt/modules/random_org.py on lines 705..708

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['significantDigits']) or not 2 <= kwargs['significantDigits'] <= 20:
                                    ret['res'] = False
                                    ret['message'] = 'The number of significant digits must be between 2 and 20'
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 237..240
                            salt/modules/random_org.py on lines 242..245
                            salt/modules/random_org.py on lines 247..250
                            salt/modules/random_org.py on lines 352..355
                            salt/modules/random_org.py on lines 357..360
                            salt/modules/random_org.py on lines 444..447
                            salt/modules/random_org.py on lines 528..531
                            salt/modules/random_org.py on lines 614..617
                            salt/modules/random_org.py on lines 619..622
                            salt/modules/random_org.py on lines 624..627
                            salt/modules/random_org.py on lines 705..708

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['decimalPlaces']) or not 1 <= kwargs['decimalPlaces'] <= 20:
                                    ret['res'] = False
                                    ret['message'] = 'Number of decimal places must be between 1 and 20'
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 237..240
                            salt/modules/random_org.py on lines 242..245
                            salt/modules/random_org.py on lines 247..250
                            salt/modules/random_org.py on lines 352..355
                            salt/modules/random_org.py on lines 357..360
                            salt/modules/random_org.py on lines 444..447
                            salt/modules/random_org.py on lines 614..617
                            salt/modules/random_org.py on lines 619..622
                            salt/modules/random_org.py on lines 624..627
                            salt/modules/random_org.py on lines 629..632
                            salt/modules/random_org.py on lines 705..708

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if not _numeric(kwargs['maximum']) or not -1000000000 <= kwargs['maximum'] <= 1000000000:
                                    ret['res'] = False
                                    ret['message'] = 'Maximum argument must be between -1,000,000,000 and 1,000,000,000'
                                    return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
                            salt/modules/random_org.py on lines 237..240
                            salt/modules/random_org.py on lines 242..245
                            salt/modules/random_org.py on lines 352..355
                            salt/modules/random_org.py on lines 357..360
                            salt/modules/random_org.py on lines 444..447
                            salt/modules/random_org.py on lines 528..531
                            salt/modules/random_org.py on lines 614..617
                            salt/modules/random_org.py on lines 619..622
                            salt/modules/random_org.py on lines 624..627
                            salt/modules/random_org.py on lines 629..632
                            salt/modules/random_org.py on lines 705..708

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

                            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

                                for item in ['number', 'minimum', 'maximum']:
                                    if item not in kwargs:
                                        ret['res'] = False
                                        ret['message'] = 'Rquired argument, {0} is missing.'.format(item)
                                        return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 1 other location - About 1 hr to fix
                            salt/modules/random_org.py on lines 346..350

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

                            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

                                for item in ['number', 'length', 'characters']:
                                    if item not in kwargs:
                                        ret['res'] = False
                                        ret['message'] = 'Required argument, {0} is missing.'.format(item)
                                        return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 1 other location - About 1 hr to fix
                            salt/modules/random_org.py on lines 231..235

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

                            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

                                for item in ['number', 'decimalPlaces']:
                                    if item not in kwargs:
                                        ret['res'] = False
                                        ret['message'] = 'Required argument, {0} is missing.'.format(item)
                                        return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 1 other location - About 1 hr to fix
                            salt/modules/random_org.py on lines 699..703

                            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

                                for item in ['number', 'size']:
                                    if item not in kwargs:
                                        ret['res'] = False
                                        ret['message'] = 'Required argument, {0} is missing.'.format(item)
                                        return ret
                            Severity: Major
                            Found in salt/modules/random_org.py and 1 other location - About 1 hr to fix
                            salt/modules/random_org.py on lines 517..521

                            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

                            There are no issues that match your filters.

                            Category
                            Status