tomgi/git_stats

View on GitHub

Showing 12 of 32 total issues

File bootstrap.js has 1412 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ===================================================
 * bootstrap-transition.js v2.1.1
 * http://twitter.github.com/bootstrap/javascript.html#transitions
 * ===================================================
 * Copyright 2012 Twitter, Inc.
Severity: Major
Found in templates/assets/bootstrap/js/bootstrap.js - About 3 days to fix

    Function getDataRows has 108 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Highcharts.Chart.prototype.getDataRows = function () {
            var options = (this.options.exporting || {}).csv || {},
                xAxis,
                xAxes = this.xAxis,
                rows = {},
    Severity: Major
    Found in templates/assets/export-csv.js - About 4 hrs to fix

      Class Repo has 30 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class Repo
            include HashInitializable
      
            delegate :files, :files_by_extension, :files_by_extension_count, :lines_by_extension,
                     :files_count, :binary_files, :text_files, :lines_count, :comments_count, to: :last_commit
      Severity: Minor
      Found in lib/git_stats/git_data/repo.rb - About 3 hrs to fix

        File export-csv.js has 285 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * A Highcharts plugin for exporting data from a rendered chart as CSV, XLS or HTML table
         *
         * Author:   Torstein Honsi
         * Licence:  MIT
        Severity: Minor
        Found in templates/assets/export-csv.js - About 2 hrs to fix

          Function show has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            , show: function () {
                var $tip
                  , inside
                  , pos
                  , actualWidth
          Severity: Minor
          Found in templates/assets/bootstrap/js/bootstrap.js - About 1 hr to fix

            Function slide has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              , slide: function (type, next) {
                  var $active = this.$element.find('.item.active')
                    , $next = next || $active[type]()
                    , isCycling = this.interval
                    , direction = type == 'next' ? 'left' : 'right'
            Severity: Minor
            Found in templates/assets/bootstrap/js/bootstrap.js - About 1 hr to fix

              Function getContent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function getContent(chart, href, extension, content, MIME) {
                      var a,
                          blobObject,
                          name,
                          options = (chart.options.exporting || {}).csv || {},
              Severity: Minor
              Found in templates/assets/export-csv.js - About 1 hr to fix

                Function getCSV has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    Highcharts.Chart.prototype.getCSV = function (useLocalDecimalPoint) {
                        var csv = '',
                            rows = this.getDataRows(),
                            options = (this.options.exporting || {}).csv || {},
                            itemDelimiter = options.itemDelimiter || ',', // use ';' for direct import to Excel
                Severity: Minor
                Found in templates/assets/export-csv.js - About 1 hr to fix

                  Function getTable has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      Highcharts.Chart.prototype.getTable = function (useLocalDecimalPoint) {
                          var html = '<table><thead>',
                              rows = this.getDataRows();
                  
                          // Transform the rows to HTML
                  Severity: Minor
                  Found in templates/assets/export-csv.js - About 1 hr to fix

                    Function show has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        , show: function () {
                            var that = this
                              , e = $.Event('show')
                    
                            this.$element.trigger(e)
                    Severity: Minor
                    Found in templates/assets/bootstrap/js/bootstrap.js - About 1 hr to fix

                      Method fill_empty_days! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def fill_empty_days!(params = {:aggregated => true})
                          return self if self.empty?
                      
                          self_with_date_keys = Hash[self.map { |k, v| [k.to_date, v] }]
                          days_with_data = self_with_date_keys.keys.sort.uniq
                      Severity: Minor
                      Found in lib/git_stats/core_extensions/hash.rb - About 45 mins 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 getContent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          function getContent(chart, href, extension, content, MIME) {
                      Severity: Minor
                      Found in templates/assets/export-csv.js - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language