saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

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

def beacon(config):
    '''
    Emit a dict with a key "msgs" whose value is a list of messages
    sent to the configured bot by one of the allowed usernames.

Severity: Minor
Found in salt/beacons/telegram_bot_msg.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, *attrs, **kwargs):
        '''
        :param attrs: are the attribute names of any format codes in `codes`

        :param kwargs: may contain
Severity: Minor
Found in salt/textformat.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 output has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def output(data, **kwargs):  # pylint: disable=unused-argument
    '''
    Print the output data in JSON
    '''
    try:
Severity: Minor
Found in salt/output/dson.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 propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function propFilter( props, specialEasing ) {
    var value, name, index, easing, hooks;

    // camelCase, specialEasing and expand cssHook pass
    for ( index in props ) {
Severity: Minor
Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

    Function setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            setup: function() {
    
                if ( rformElems.test( this.nodeName ) ) {
                    // IE doesn't fire change on a check/radio until blur; trigger it on click
                    // after a propertychange. Eat the blur-change in special.change.handle.
    Severity: Minor
    Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

      Function security_rule_exists has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def security_rule_exists(name,
                               rulename=None,
                               vsys='1',
                               action=None,
                               disabled=None,
      Severity: Minor
      Found in salt/states/panos.py - About 1 hr to fix

        Function run has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def run(self):
                '''
                Main loop of the ConCache, starts updates in intervals and
                answers requests from the MWorkers
                '''
        Severity: Minor
        Found in salt/utils/master.py - About 1 hr to fix

          Function parse_network has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def parse_network(rule):
              '''
              Parse the network line
              '''
              parser = argparse.ArgumentParser()
          Severity: Minor
          Found in salt/utils/kickstart.py - About 1 hr to fix

            Function index has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def index(command,
                      platform=None,
                      platform_grain_name=None,
                      platform_column_name=None,
                      output=None,
            Severity: Minor
            Found in salt/modules/textfsm_mod.py - About 1 hr to fix

              Function remove has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def remove(name=None,
                         pkgs=None,
                         jail=None,
                         chroot=None,
                         root=None,
              Severity: Minor
              Found in salt/modules/pkgng.py - About 1 hr to fix

                Function sync_all has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                def sync_all(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
                    '''
                    Sync all custom types
                
                    saltenv : base
                Severity: Minor
                Found in salt/runners/saltutil.py - About 1 hr to fix

                  Function offset has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  jQuery.fn.offset = function( options ) {
                      if ( arguments.length ) {
                          return options === undefined ?
                              this :
                              this.each(function( i ) {
                  Severity: Minor
                  Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

                    Function bind has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          Function.prototype.bind = function bind(that) {
                    
                            var target = this;
                    
                            if (typeof target != "function") {

                      Function isEventSupported has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          isEventSupported = (function() {
                      
                            var TAGNAMES = {
                              'select': 'input', 'change': 'input',
                              'submit': 'form', 'reset': 'form',

                        Function keydown has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          , keydown: function (e) {
                              var $this
                                , $items
                                , $active
                                , $parent
                        Severity: Minor
                        Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js - About 1 hr to fix

                          Function off has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              off: function( types, selector, fn ) {
                                  var handleObj, type;
                                  if ( types && types.preventDefault && types.handleObj ) {
                                      // ( event )  dispatched jQuery.Event
                                      handleObj = types.handleObj;
                          Severity: Minor
                          Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

                            Function managed has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            def managed(name, users=None, defaults=None):
                            
                                '''
                                Manages the configuration of the users on the device, as specified in the state SLS file. Users not defined in that
                                file will be remove whilst users not configured on the device, will be added.
                            Severity: Minor
                            Found in salt/states/netusers.py - About 1 hr to fix

                              Function __init__ has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def __init__(
                                          self,
                                          opts,
                                          argv,
                                          id_,
                              Severity: Minor
                              Found in salt/client/ssh/__init__.py - About 1 hr to fix

                                Function create_ca_signed_cert has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                def create_ca_signed_cert(ca_name,
                                                          CN,
                                                          days=365,
                                                          cacert_path=None,
                                                          ca_filename=None,
                                Severity: Minor
                                Found in salt/modules/tls.py - About 1 hr to fix

                                  Function upgrade has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  def upgrade(*names, **kwargs):
                                      '''
                                      Upgrade named or all packages (run a ``pkg upgrade``). If <package name> is
                                      omitted, the operation is executed on all packages.
                                  
                                  
                                  Severity: Minor
                                  Found in salt/modules/pkgng.py - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language