gecos-team/gecoscc-ui

View on GitHub

Showing 845 of 1,621 total issues

File __init__.py has 513 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from __future__ import division
#
# Copyright 2013, Junta de Andalucia
# http://www.juntadeandalucia.es/
#
Severity: Major
Found in gecoscc/api/__init__.py - About 1 day to fix

    Function report_printers has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
    Open

    def report_printers(context, request, file_ext):
        '''
        Generate a report with all the printers and its related computers.
    
        
    Severity: Minor
    Found in gecoscc/views/report_printers.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 lazy has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

    def lazy(func, *resultclasses):
        """
        Turns any callable into a lazy evaluated callable. You need to give result
        classes or types -- at least one is needed so that the automatic forcing of
        the lazy evaluation code is triggered. Results are not memoized; the
    Severity: Minor
    Found in gecoscc/lazy.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 report_storages has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
    Open

    def report_storages(context, request, file_ext):
        '''
        Generate a report with all the storages and its related users.
    
        
    Severity: Minor
    Found in gecoscc/views/report_storages.py - About 7 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 remove_chef_user_data has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

    def remove_chef_user_data(user, computers, api, policy_fields=None):
        '''
        Remove computer policies in chef node
        '''
        settings = get_current_registry().settings
    Severity: Minor
    Found in gecoscc/utils.py - About 7 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 apply_change_in_inheritance has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

    def apply_change_in_inheritance(logger, db, action, obj, policy, node, inheritanceTree):
        """Function that looks for the node that received the change (obj) inside the inheritance tree
           and performs the change in its policies.
    
        Args:
    Severity: Minor
    Found in gecoscc/utils.py - About 7 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

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

    /*jslint browser: true, nomen: true, unparam: true */
    /*global App, gettext, GecosUtils */
    
    /*
    * Copyright 2013, Junta de Andalucia
    Severity: Minor
    Found in gecoscc/static/js/tree-views.js - About 7 hrs to fix

      Function report_permission has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
      Open

      def report_permission(context, request, file_ext):
          '''
          Generate a report with all the admin permissions.
          
          Args:
      Severity: Minor
      Found in gecoscc/views/report_permission.py - About 7 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 add_group_to_inheritance_tree has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
      Open

      def add_group_to_inheritance_tree(logger, db, group, inheritanceTree):
          """Function that adds a group to the inheritance tree of an object.
      
          Args:
              logger (object): Logger.
      Severity: Minor
      Found in gecoscc/utils.py - About 7 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 buildFromLayout has 184 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      formTree.prototype.buildFromLayout = function (formElement, context) {
        var schemaElement = null;
        var node = new formNode();
        var view = null;
        var key = null;
      Severity: Major
      Found in gecoscc/static/js/libs/jsonform-b3-1.0.0.js - About 7 hrs to fix

        Function _fnScrollDraw has 182 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function _fnScrollDraw ( o )
                {
                    var
                        nScrollHeadInner = o.nScrollHead.getElementsByTagName('div')[0],
                        nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
        Severity: Major
        Found in gecoscc/static/js/libs/jquery.dataTables-1.9.4.js - About 7 hrs to fix

          Function update_node has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
          Open

              def update_node(self, user, computer, obj, objold, node, action, parent_id, job_ids_by_computer, force_update):
                  '''
                  This method update the node with changed or created actions.
                  Have two different cases:
                      1 - object type is ou, user, computer or group.
          Severity: Minor
          Found in gecoscc/tasks.py - About 7 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 get has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
          Open

              def get(self):
                  result = super(ComputerResource, self).get()
                  node_collection = self.request.db.nodes
                  
                  if not result.get('node_chef_id', None):
          Severity: Minor
          Found in gecoscc/api/computers.py - About 7 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 move_in_inheritance_and_recalculate_policies has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
          Open

          def move_in_inheritance_and_recalculate_policies(logger, db, srcobj, obj):
              """Move an object to another position in the inheritance Tree and recalculate
                 the policies of the added nodes.
          
              Args:
          Severity: Minor
          Found in gecoscc/utils.py - About 7 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 1 has 179 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
          var mergeSort, findInsertIndex;
          mergeSort = require('mergesort');
          findInsertIndex = require('find-insert-index');
          
          
          Severity: Major
          Found in gecoscc/static/js/libs/TreeModel-0.4.0.js - About 7 hrs to fix

            Function get_default_data has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_default_data(self, dotted_keys):
                    # Get gecos_ws_mgmt cookbook version
                    data = None
                    try:
                        data = self.api['/organizations/default/cookbooks/gecos_ws_mgmt']
            Severity: Minor
            Found in gecoscc/commands/check_node_policies.py - About 7 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 check_user_data has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                def check_user_data(self, user):
                    if user['type'] != 'user':
                        raise ValueError('user must be an user')
                    
                    if ((not 'email' in user or user['email']=='') and
            Severity: Minor
            Found in gecoscc/commands/check_node_policies.py - About 7 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

            BaseGecosTestCase has 50 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class BaseGecosTestCase(unittest.TestCase):
            
                def setUp(self):
                    '''
                    1. Parser test.ini
            Severity: Minor
            Found in gecoscc/tests.py - About 7 hrs to fix

              Function exports has 173 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = (function () {
                'use strict';
              
                var walkStrategies;
              
              
              Severity: Major
              Found in gecoscc/static/js/libs/TreeModel-0.4.0.js - About 6 hrs to fix

                File server.py has 449 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                from __future__ import division
                #
                # Copyright 2015, Junta de Andalucia
                # http://www.juntadeandalucia.es/
                #
                Severity: Minor
                Found in gecoscc/views/server.py - About 6 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language