gecos-team/gecoscc-ui

View on GitHub

Showing 845 of 1,621 total issues

Function _fnFeatureHtmlTable has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function _fnFeatureHtmlTable ( oSettings )
        {
            /* Check if scrolling is enabled or not - if not then leave the DOM unaltered */
            if ( oSettings.oScroll.sX === "" && oSettings.oScroll.sY === "" )
            {
Severity: Major
Found in gecoscc/static/js/libs/jquery.dataTables-1.9.4.js - About 4 hrs to fix

    Function _parseAndSetRecurrencePattern has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                _parseAndSetRecurrencePattern: function( recurrencePattern, startTime ) {
                    var recur = {};
                    var i = 0;
                    var item = '';
                    var commaPatternSplit;
    Severity: Major
    Found in gecoscc/static/js/libs/fuelux.js - About 4 hrs to fix

      Function _fnAddOptionsHtml has 111 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function _fnAddOptionsHtml ( oSettings )
              {
                  /*
                   * Create a temporary, empty, div which we can later on replace with what we have generated
                   * we do it this way to rendering the 'options' html offline - speed :-)
      Severity: Major
      Found in gecoscc/static/js/libs/jquery.dataTables-1.9.4.js - About 4 hrs to fix

        Function server_status has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def server_status(context, request):
            # Delete a non existent server?
            server_name = request.GET.get('delete', None)
            if server_name:
                request.db.servers.delete_one({"name": server_name})
        Severity: Minor
        Found in gecoscc/views/server.py - About 4 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 _nested_lookup has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def _nested_lookup(key, document):
            """Lookup a key in a nested document, yield a value"""
            from six import iteritems
        
            if isinstance(document, list):
        Severity: Minor
        Found in gecoscc/utils.py - About 4 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 renderMonth has 109 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    renderMonth: function( date ) {
                        date = date || new Date();
        
                        var firstDay = new Date( date.getFullYear(), date.getMonth(), 1 ).getDay();
                        var lastDate = new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate();
        Severity: Major
        Found in gecoscc/static/js/libs/fuelux.js - About 4 hrs to fix

          Function Behaviors has 109 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Marionette.Behaviors = (function(Marionette, _) {
          
            function Behaviors(view) {
              this.behaviors = Behaviors.parseBehaviors(view, view.behaviors);
          
          
          Severity: Major
          Found in gecoscc/static/js/libs/backbone-marionette-1.7.3.js - About 4 hrs to fix

            BasicTests has 34 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class BasicTests(BaseGecosTestCase):
            
                def test_01_home(self):
                    '''
                    Test 1: Check the home works
            Severity: Minor
            Found in gecoscc/tests.py - About 4 hrs to fix

              Function Repeater has 107 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      var Repeater = function Repeater( element, options ) {
                          var self = this;
                          var $btn;
                          var currentView;
              
              
              Severity: Major
              Found in gecoscc/static/js/libs/fuelux.js - About 4 hrs to fix

                Function has_changed_user_policy has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                    def has_changed_user_policy(self, node, obj_ui, objold_ui, field_chef, priority_obj):
                        '''
                        This method checks whether the "field_chef" policy field changed for the current object.
                
                        Args:
                Severity: Minor
                Found in gecoscc/tasks.py - About 4 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 convert has a Cognitive Complexity of 28 (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/automatic_updates.py - About 4 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 getValue has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            getValue: function getValue() {
                                // FREQ = frequency (secondly, minutely, hourly, daily, weekdays, weekly, monthly, yearly)
                                // BYDAY = when picking days (MO,TU,WE,etc)
                                // BYMONTH = when picking months (Jan,Feb,March) - note the values should be 1,2,3...
                                // BYMONTHDAY = when picking days of the month (1,2,3...)
                Severity: Major
                Found in gecoscc/static/js/libs/fuelux.js - About 4 hrs to fix

                  Function _fnSortingClasses has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function _fnSortingClasses( oSettings )
                          {
                              var i, iLen, j, jLen, iFound;
                              var aaSort, sClass;
                              var iColumns = oSettings.aoColumns.length;
                  Severity: Major
                  Found in gecoscc/static/js/libs/jquery.dataTables-1.9.4.js - About 4 hrs to fix

                    AdvancedTests has 32 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class AdvancedTests(BaseGecosTestCase):
                    
                        @mock.patch('gecoscc.forms.create_chef_admin_user')
                        @mock.patch('gecoscc.forms._')
                        @mock.patch('gecoscc.utils.isinstance')
                    Severity: Minor
                    Found in gecoscc/tests.py - About 4 hrs to fix

                      Function onInsert has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          'onInsert': function (evt, node) {
                            var $nodeid = $(node.el).find('#' + escapeSelector(node.id));
                            var boundaries = node.getArrayBoundaries();
                            node.resetDeleteEvents();
                      
                      
                      Severity: Major
                      Found in gecoscc/static/js/libs/jsonform-b3-1.0.0.js - About 3 hrs to fix

                        Function server_log has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def server_log(context, request):
                            # Get the name of the server
                            server_name = request.GET.get('server', None)
                            if server_name is None:
                                logger.error("server_log: server name is mandatory")
                        Severity: Minor
                        Found in gecoscc/views/server.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 command has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def command(self):
                                db = self.pyramid.db
                                ou = db.nodes.find_one({'_id': ObjectId(self.options.ou_id)})
                                if not ou:
                                    print('Error OU does not exists')
                        Severity: Minor
                        Found in gecoscc/commands/create_nodes.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 test_03_admins has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def test_03_admins(self, adminuservariablesmodel,
                                               permissionsmodel, adminusermodel, gettext,
                                               gettext_forms, gettext_models, gettext_i18n,
                                               get_chef_api_method, get_chef_api_models_method):
                                '''
                        Severity: Major
                        Found in gecoscc/tests.py - About 3 hrs to fix

                          Function Wreqr has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                          Open

                          Backbone.Wreqr = (function(Backbone, Marionette, _){
                            "use strict";
                            var Wreqr = {};
                          
                            // Handlers
                          Severity: Minor
                          Found in gecoscc/static/js/libs/backbone-marionette-1.7.3.js - 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 init has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function init (converter) {
                                  function api (key, value, attributes) {
                                      var result;
                                      if (typeof document === 'undefined') {
                                          return;
                          Severity: Major
                          Found in gecoscc/static/js/libs/js.cookie.js - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language