maestrano/mno-enterprise

View on GitHub

Showing 152 of 305 total issues

File ui-bootstrap-tpls-0.13.4.js has 4537 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * angular-ui-bootstrap
 * http://angular-ui.github.io/bootstrap/

 * Version: 0.13.4 - 2015-09-03

    File xeditable.js has 947 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
    angular-xeditable - 0.1.8
    Edit-in-place for angular.js
    Build date: 2014-01-10 
    */
    Severity: Major
    Found in frontend/app/assets/javascripts/mno_enterprise/lib/xeditable.js - About 2 days to fix

      Function link has 275 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            link: function(originalScope, element, attrs, ctrls) {
              var modelCtrl = ctrls[0];
              var ngModelOptions = ctrls[1];
              //SUPPORTED ATTRIBUTES (OPTIONS)
      
      

        Function $get has 270 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          this.$get = ['$window', '$compile', '$timeout', '$document', '$position', '$interpolate', '$rootScope', '$parse', function($window, $compile, $timeout, $document, $position, $interpolate, $rootScope, $parse) {
            return function $tooltip(type, prefix, defaultTriggerShow, options) {
              options = angular.extend({}, defaultOptions, globalOptions, options);
        
              /**

          Function $tooltip has 268 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              return function $tooltip(type, prefix, defaultTriggerShow, options) {
                options = angular.extend({}, defaultOptions, globalOptions, options);
          
                /**
                 * Returns an object of show and hide triggers.

            Method add_page_body has 260 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def add_page_body
                  payment_enabled = !Settings.payment.disabled
            
                  @pdf.stroke_color '999999'
            
            
            Severity: Major
            Found in core/app/pdf/mno_enterprise/invoice_pdf.rb - About 1 day to fix

              Function link has 248 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  link: function(scope, element, attrs, ngModel) {
                    var dateFormat,
                        closeOnDateSelection = angular.isDefined(attrs.closeOnDateSelection) ? scope.$parent.$eval(attrs.closeOnDateSelection) : datepickerPopupConfig.closeOnDateSelection,
                        appendToBody = angular.isDefined(attrs.datepickerAppendToBody) ? scope.$parent.$eval(attrs.datepickerAppendToBody) : datepickerPopupConfig.appendToBody,
                        onOpenFocus = angular.isDefined(attrs.onOpenFocus) ? scope.$parent.$eval(attrs.onOpenFocus) : datepickerPopupConfig.onOpenFocus,

                Function compile has 236 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        compile: function(tElem, tAttrs) {
                          var tooltipLinker = $compile( template );
                
                          return function link(scope, element, attrs, tooltipCtrl) {
                            var tooltip;

                  Function link has 233 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                            return function link(scope, element, attrs, tooltipCtrl) {
                              var tooltip;
                              var tooltipLinkedScope;
                              var transitionTimeout;
                              var popupTimeout;

                    Function EditableController has 227 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function EditableController($scope, $attrs, $element, $parse, editableThemes, editableOptions, $rootScope, $compile, $q) {
                        var valueGetter;
                    
                        //if control is disabled - it does not participate in waiting process
                        var inWaiting;
                    Severity: Major
                    Found in frontend/app/assets/javascripts/mno_enterprise/lib/xeditable.js - About 1 day to fix

                      Function link has 184 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              link: function(scope, element, attrs, ngModel) {
                                var savedNodes;
                      
                                function combineCallbacks(first,second){
                                  if(second && (typeof second === 'function')) {
                      Severity: Major
                      Found in frontend/app/assets/javascripts/mno_enterprise/lib/sortable.js - About 7 hrs to fix

                        Method api_stub_configure has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def api_stub_configure(api)
                              # This block should match the her.rb initializer
                              api.setup MnoEnterprise.send(:api_options).merge(url: "http://localhost:65000") do |c|
                                # Request
                                c.use Faraday::Request::BasicAuthentication, MnoEnterprise.tenant_id, MnoEnterprise.tenant_key

                        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

                        Method add_page_body has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def add_page_body
                              payment_enabled = !Settings.payment.disabled
                        
                              @pdf.stroke_color '999999'
                        
                        
                        Severity: Minor
                        Found in core/app/pdf/mno_enterprise/invoice_pdf.rb - About 5 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 invoice_pdf.rb has 385 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        module MnoEnterprise
                          class InvoicePdf
                            include MnoEnterprise::ImageHelper
                            attr_reader :invoice, :pdf, :data
                        
                        
                        Severity: Minor
                        Found in core/app/pdf/mno_enterprise/invoice_pdf.rb - About 5 hrs to fix

                          File tooltip.js has 340 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /* ========================================================================
                           * Bootstrap: tooltip.js v3.3.2
                           * http://getbootstrap.com/javascript/#tooltip
                           * Inspired by the original jQuery.tipsy by Jason Frame
                           * ========================================================================

                            Function $get has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function ($injector, $rootScope, $q, $templateRequest, $controller, $modalStack) {
                                      var $modal = {};
                            
                                      function getTemplatePromise(options) {
                                        return options.template ? $q.when(options.template) :

                              Function link has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  link: function(scope, element, attrs, ctrl) {
                                    scope.showWeeks = ctrl.showWeeks;
                              
                                    ctrl.step = { months: 1 };
                                    ctrl.element = element;

                                Method create has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def create
                                    #  Filling the time at which TOS were accepted
                                    if params[:tos]
                                      params[:user][:meta_data] = {tos_accepted_at: Time.current}
                                    end

                                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 compile has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      compile: function() {
                                        return {
                                          pre: function(scope, elem, attrs, ctrl) {
                                            var form = ctrl[0];
                                            var eForm;
                                Severity: Major
                                Found in frontend/app/assets/javascripts/mno_enterprise/lib/xeditable.js - About 2 hrs to fix

                                  Function open has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                            $modal.open = function (modalOptions) {
                                  
                                              var modalResultDeferred = $q.defer();
                                              var modalOpenedDeferred = $q.defer();
                                              var modalRenderDeferred = $q.defer();
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language