maestrano/mno-enterprise

View on GitHub

Showing 305 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

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                              render: function() {
                                this.parent.render.call(this);
                                var parsed = editableNgOptionsParser(this.attrs.eNgOptions);
                                var html = '<label ng-repeat="'+parsed.ngRepeat+'">'+
                                  '<input type="radio" ng-model="$parent.$data" value="{{'+parsed.locals.valueFn+'}}">'+
                        frontend/app/assets/javascripts/mno_enterprise/lib/xeditable.js on lines 137..147

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 152.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                              render: function() {
                                this.parent.render.call(this);
                                var parsed = editableNgOptionsParser(this.attrs.eNgOptions);
                                var html = '<label ng-repeat="'+parsed.ngRepeat+'">'+
                                  '<input type="checkbox" checklist-model="$parent.$data" checklist-value="'+parsed.locals.valueFn+'">'+
                        frontend/app/assets/javascripts/mno_enterprise/lib/xeditable.js on lines 196..206

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 152.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        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

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                            function Plugin(option) {
                              return this.each(function () {
                                var $this   = $(this)
                                var data    = $this.data('bs.popover')
                                var options = typeof option == 'object' && option
                          frontend/app/assets/javascripts/mno_enterprise/twitter/bootstrap/tooltip.js on lines 446..456

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 133.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                            function Plugin(option) {
                              return this.each(function () {
                                var $this   = $(this)
                                var data    = $this.data('bs.tooltip')
                                var options = typeof option == 'object' && option
                          frontend/app/assets/javascripts/mno_enterprise/twitter/bootstrap/popover.js on lines 87..97

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 133.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          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
                           * ========================================================================

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                              function Plugin(option) {
                                return this.each(function () {
                                  var $this   = $(this)
                                  var data    = $this.data('bs.scrollspy')
                                  var options = typeof option == 'object' && option
                            frontend/app/assets/javascripts/mno_enterprise/twitter/bootstrap/affix.js on lines 119..128

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 118.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language