gecos-team/gecoscc-ui

View on GitHub

Showing 845 of 1,621 total issues

File check_node_policies.py has 725 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#
# Copyright 2017, Junta de Andalucia
# http://www.juntadeandalucia.es/
#
# Authors:
Severity: Major
Found in gecoscc/commands/check_node_policies.py - About 1 day to fix

    ChefTask has 86 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ChefTask(Task):
        abstract = True
        # Since Celery 4 the default serializer is "json", but we need "pickle"
        serializer = 'pickle'
        
    Severity: Major
    Found in gecoscc/tasks.py - About 1 day to fix

      File backbone.paginator-0.8.1.js has 695 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*! backbone.paginator - v0.8.1 - 7/3/2013
      * http://github.com/addyosmani/backbone.paginator
      * Copyright (c) 2013 Addy Osmani; Licensed MIT */
      /*globals Backbone:true, _:true, jQuery:true*/
      Backbone.Paginator = (function ( Backbone, _, $ ) {
      Severity: Major
      Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 1 day to fix

        Function computer_refresh_policies has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
        Open

            def computer_refresh_policies(self, user, obj, computers=None):
                # Refresh policies of a computer
                self.log_action('refresh_policies BEGIN', 'Computer', obj)
                settings = get_current_registry().settings
        
        
        Severity: Minor
        Found in gecoscc/tasks.py - About 1 day 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 chef_status_sync has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
        Open

        def chef_status_sync(node_id, auth_user):
            self = chef_status_sync
            settings = get_current_registry().settings
            api = get_chef_api(settings, auth_user)   
            node = Node(node_id, api)    
        Severity: Minor
        Found in gecoscc/tasks.py - About 1 day 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

        File jjv.js has 662 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* jshint proto: true */
        
        /**
         * jjv.js -- A javascript library to validate json input through a json-schema.
         *
        Severity: Major
        Found in gecoscc/static/js/libs/jjv.js - About 1 day to fix

          Function command has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
          Open

              def command(self):
                  # Initialization
                  self.api = _get_chef_api(self.settings.get('chef.url'),
                                      toChefUsername(self.options.chef_username),
                                      self.options.chef_pem, False,
          Severity: Minor
          Found in gecoscc/commands/check_node_policies.py - About 1 day 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

          File ad_import.py has 638 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          
          #
          # Copyright 2013, Junta de Andalucia
          # http://www.juntadeandalucia.es/
          Severity: Major
          Found in gecoscc/api/ad_import.py - About 1 day to fix

            Function convert has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
            Open

                def convert(self, xmlgpo):
                    if self.policy is None:
                        return None
            
                    result = [{
            Severity: Minor
            Found in gecoscc/api/gpoconversors/file_browser.py - About 1 day 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 move_in_inheritance has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
            Open

            def move_in_inheritance(logger, db, obj, inheritanceTree):
                """Move an object to another position in the inheritance Tree.
            
                Args:
                    logger (object): Logger.
            Severity: Minor
            Found in gecoscc/utils.py - About 1 day 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

            File tree.js has 612 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*jslint browser: true, nomen: true, unparam: true */
            /*global App, TreeModel, gettext */
            
            /*
            * Copyright 2013, Junta de Andalucia
            Severity: Major
            Found in gecoscc/static/js/tree.js - About 1 day to fix

              File computer.js has 608 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*jslint browser: true, nomen: true, unparam: true, vars: false */
              /*global App, gettext */
              
              /*
              * Copyright 2013, Junta de Andalucia
              Severity: Major
              Found in gecoscc/static/js/computer.js - About 1 day to fix

                Function checkValidity has 261 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  var checkValidity = function (env, schema_stack, object_stack, options) {
                    var i, len, count, hasProp, hasPattern;
                    var p, v, malformed = false, objerrs = {}, objerr, props, matched;
                    var sl = schema_stack.length-1, schema = schema_stack[sl], new_stack;
                    var ol = object_stack.length-1, object = object_stack[ol].object, name = object_stack[ol].key, prop = object[name];
                Severity: Major
                Found in gecoscc/static/js/libs/jjv.js - About 1 day to fix

                  Function _convertADObjectToMongoObject has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _convertADObjectToMongoObject(self, domain, mongoObjects, objSchema, adObj, is_ad_master, report, objects_apply_policy):
                  
                          def update_object(self, objSchema, mongoObj, adObj):
                              """
                              Update an object from a collection with a GUID in common.
                  Severity: Minor
                  Found in gecoscc/api/ad_import.py - About 1 day 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 calculate_initial_inheritance_for_node has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def calculate_initial_inheritance_for_node(logger, db, node):
                      """Function that calculates the initial "inheritance" field of a node.
                  
                      Args:
                          logger (object): Logger.
                  Severity: Minor
                  Found in gecoscc/utils.py - About 1 day 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 command has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def command(self):
                          api = _get_chef_api(self.settings.get('chef.url'),
                                              toChefUsername(self.options.chef_username),
                                              self.options.chef_pem,
                                              self.settings.get('chef.ssl.verify'),
                  Severity: Minor
                  Found in gecoscc/commands/import_policies.py - About 1 day 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

                  File admins.py has 532 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  #
                  # Copyright 2013, Junta de Andalucia
                  # http://www.juntadeandalucia.es/
                  #
                  # Authors:
                  Severity: Major
                  Found in gecoscc/views/admins.py - About 1 day to fix

                    File app-utils.js has 531 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /*jslint browser: true, vars: false, nomen: true */
                    /*global App, Backbone, jQuery, _, gettext, interpolate */
                    
                    /*
                    * Copyright 2013, Junta de Andalucia
                    Severity: Major
                    Found in gecoscc/static/js/app-utils.js - About 1 day to fix

                      Function check_node has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def check_node(self, node):
                              '''
                              Check the policies applied to a node
                              '''        
                              logger.info('Checking node: "%s" type:%s path: %s'%(node['name'],
                      Severity: Minor
                      Found in gecoscc/commands/check_node_policies.py - About 1 day 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 onInsert has 208 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          'onInsert': function (evt, node) {
                            var schemaElmnt = ((node.parentNode.schemaElement && node.parentNode.schemaElement.autocomplete_url)?node.parentNode.schemaElement:node.schemaElement),
                                promise,
                                pagesize = 30,
                                more,
                      Severity: Major
                      Found in gecoscc/static/js/libs/jsonform-b3-1.0.0.js - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language