saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function each has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    each: function( obj, callback, args ) {
        var value,
            i = 0,
            length = obj.length,
            isArray = isArraylike( obj );
Severity: Minor
Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

    Function extracted has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def extracted(name,
                  source,
                  source_hash=None,
                  source_hash_name=None,
                  source_hash_update=False,
    Severity: Minor
    Found in salt/states/archive.py - About 1 hr to fix

      Function _mixin_setup has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def _mixin_setup(self):
              self.add_option(
                  '-r', '--raw', '--raw-shell',
                  dest='raw_shell',
                  default=False,
      Severity: Minor
      Found in salt/utils/parsers.py - About 1 hr to fix

        Function showHide has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function showHide( elements, show ) {
            var display, elem, hidden,
                values = [],
                index = 0,
                length = elements.length;
        Severity: Minor
        Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

          Function _policies_present has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def _policies_present(name, policies, policies_from_pillar, listeners, backends,
                                region, key, keyid, profile):
              '''helper method for present. ensure that ELB policies are set'''
              if policies is None:
                  policies = []
          Severity: Minor
          Found in salt/states/boto_elb.py - About 1 hr to fix

            Function create has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def create(vm_):
                '''
                Create a single VM from a data dict
                '''
                try:
            Severity: Minor
            Found in salt/cloud/clouds/softlayer_hw.py - About 1 hr to fix

              Function when has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  when: function( subordinate /* , ..., subordinateN */ ) {
                      var i = 0,
                          resolveValues = core_slice.call( arguments ),
                          length = resolveValues.length,
              
              
              Severity: Minor
              Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

                Function gen_thin has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                def gen_thin(cachedir, extra_mods='', overwrite=False, so_mods='',
                             python2_bin='python2', python3_bin='python3', absonly=True,
                             compress='gzip', extended_cfg=None):
                    '''
                    Generate the salt-thin tarball and print the location of the tarball
                Severity: Minor
                Found in salt/utils/thin.py - About 1 hr to fix

                  Function create_ca has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def create_ca(ca_name,
                                bits=2048,
                                days=365,
                                CN='localhost',
                                C='US',
                  Severity: Minor
                  Found in salt/modules/tls.py - About 1 hr to fix

                    Function call has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def call(self, low, chunks=None, running=None, retries=1):
                            '''
                            Call a state directly with the low data structure, verify data
                            before processing.
                            '''
                    Severity: Minor
                    Found in salt/state.py - About 1 hr to fix

                      Function _connect has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _connect(self):
                              '''
                              Try to connect for the rest of time!
                              '''
                              while True:
                      Severity: Minor
                      Found in salt/transport/tcp.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 run has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def run(self):
                              if self.download_bootstrap_script is True:
                                  # Let's update the bootstrap-script to the version defined to be
                                  # distributed. See BOOTSTRAP_SCRIPT_DISTRIBUTED_VERSION above.
                                  url = (
                      Severity: Minor
                      Found in setup.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 handle_key_rotate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def handle_key_rotate(self, now):
                              '''
                              Rotate the AES key rotation
                              '''
                              to_rotate = False
                      Severity: Minor
                      Found in salt/master.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 parse_hostname has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def parse_hostname(hostname, default_port):
                          '''
                          Parse hostname string and return a tuple of (host, port)
                          If port missing in hostname string then use default_port
                          If anything is not a valid then return None
                      Severity: Minor
                      Found in salt/daemons/__init__.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 __init__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def __init__(self, uri, server, port,
                                       starttls, tls, no_verify,
                                       binddn, bindpw,
                                       anonymous, accountattributename, activedirectory=False):
                              '''
                      Severity: Minor
                      Found in salt/auth/ldap.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 save_load has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def save_load(jid, load, minions=None):
                          '''
                          Save the load to the specified jid.
                          '''
                          write_profile = __opts__.get('etcd.returner_write_profile')
                      Severity: Minor
                      Found in salt/returners/etcd_return.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 save_minions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def save_minions(jid, minions, syndic_id=None):
                          '''
                          Save/update the serialized list of minions for a given job
                          '''
                          # Ensure we have a list for Python 3 compatability
                      Severity: Minor
                      Found in salt/returners/local_cache.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 get_jids_filter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def get_jids_filter(count, filter_find_job=True):
                          '''
                          Return a list of all job ids
                          :param int count: show not more than the count of most recent jobs
                          :param bool filter_find_jobs: filter out 'saltutil.find_job' jobs
                      Severity: Minor
                      Found in salt/returners/etcd_return.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 present has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def present(name, **kwargs):
                          '''
                          Ensures that the host group exists, eventually creates new host group.
                      
                          .. versionadded:: 2016.3.0
                      Severity: Minor
                      Found in salt/states/zabbix_hostgroup.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 save_load has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def save_load(jid, clear_load, minions=None, recurse_count=0):
                          '''
                          Save the load to the specified jid
                      
                          minions argument is to provide a pre-computed list of matched minions for
                      Severity: Minor
                      Found in salt/returners/local_cache.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

                      Severity
                      Category
                      Status
                      Source
                      Language