dhgwilliam/google-voice-stats

View on GitHub

Showing 231 of 371 total issues

Function find has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    find: function( selector ) {
        var self = this,
            i, l;

        if ( typeof selector !== "string" ) {
Severity: Minor
Found in public/js/jquery.js - About 1 hr to fix

    Function apportion has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          function apportion(node, previousSibling, ancestor) {
            if (previousSibling) {
              var vip = node, vop = node, vim = previousSibling, vom = node.parent.children[0], sip = vip._tree.mod, sop = vop._tree.mod, sim = vim._tree.mod, som = vom._tree.mod, shift;
              while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {
                vom = d3_layout_treeLeft(vom);
    Severity: Minor
    Found in public/js/d3.v2.js - About 1 hr to fix

      Function diagonal has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        d3.svg.diagonal = function() {
          function diagonal(d, i) {
            var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, {
              x: p0.x,
              y: m
      Severity: Minor
      Found in public/js/d3.v2.js - About 1 hr to fix

        Function brush has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function brush(g) {
              g.each(function() {
                var g = d3.select(this), bg = g.selectAll(".background").data([ 0 ]), fg = g.selectAll(".extent").data([ 0 ]), tz = g.selectAll(".resize").data(resizes, String), e;
                g.style("pointer-events", "all").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart);
                bg.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair");
        Severity: Minor
        Found in public/js/d3.v2.js - About 1 hr to fix

          Function d3_geo_greatArcInterpolator has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function d3_geo_greatArcInterpolator() {
              function interpolate(t) {
                var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1;
                return [ Math.atan2(y, x) / d3_geo_radians, Math.atan2(z, Math.sqrt(x * x + y * y)) / d3_geo_radians ];
              }
          Severity: Minor
          Found in public/js/d3.v2.js - About 1 hr to fix

            Function position has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function position(row, u, rect, flush) {
                  var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o;
                  if (u == rect.dx) {
                    if (flush || v > rect.dy) v = rect.dy;
                    while (++i < n) {
            Severity: Minor
            Found in public/js/d3.v2.js - About 1 hr to fix

              Method generate_sip_corpus has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                def generate_sip_corpus
                  sip_corpus = {}
                  Person.all.each do |person|
                    unless person.id == "1"
                      @dictionary = sips_for(person.id, false)
              Severity: Minor
              Found in helpers.rb - About 1 hr 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 show has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  show: function( speed, easing, callback ) {
                      var elem, display;
              
                      if ( speed || speed === 0 ) {
                          return this.animate( genFx("show", 3), speed, easing, callback );
              Severity: Minor
              Found in public/js/jquery.js - About 1 hr to fix

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

                    html: function( value ) {
                        if ( value === undefined ) {
                            return this[0] && this[0].nodeType === 1 ?
                                this[0].innerHTML.replace(rinlinejQuery, "") :
                                null;
                Severity: Minor
                Found in public/js/jquery.js - About 1 hr to fix

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

                          setup: function() {
                  
                              if ( rformElems.test( this.nodeName ) ) {
                                  // IE doesn't fire change on a check/radio until blur; trigger it on click
                                  // after a propertychange. Eat the blur-change in special.change.handle.
                  Severity: Minor
                  Found in public/js/jquery.js - About 1 hr to fix

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

                        addClass: function( value ) {
                            var classNames, i, l, elem,
                                setClass, c, cl;
                    
                            if ( jQuery.isFunction( value ) ) {
                    Severity: Minor
                    Found in public/js/jquery.js - About 1 hr to fix

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

                            function brushmove() {
                              var point = mouse(), moved = false;
                              if (offset) {
                                point[0] += offset[0];
                                point[1] += offset[1];
                      Severity: Minor
                      Found in public/js/d3.v2.js - About 1 hr to fix

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

                        jQuery.buildFragment = function( args, nodes, scripts ) {
                            var fragment, cacheable, cacheresults, doc,
                            first = args[ 0 ];
                        
                            // nodes may contain either an explicit document object,
                        Severity: Minor
                        Found in public/js/jquery.js - About 1 hr to fix

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

                            function d3_selection_on(type, listener, capture) {
                              function onRemove() {
                                var wrapper = this[name];
                                if (wrapper) {
                                  this.removeEventListener(type, wrapper, wrapper.$);
                          Severity: Minor
                          Found in public/js/d3.v2.js - About 1 hr to fix

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

                            function cloneFixAttributes( src, dest ) {
                                var nodeName;
                            
                                // We do not need to do anything for non-Elements
                                if ( dest.nodeType !== 1 ) {
                            Severity: Minor
                            Found in public/js/jquery.js - About 1 hr to fix

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

                                      ">": function( checkSet, part ) {
                                          var elem,
                                              isPartStr = typeof part === "string",
                                              i = 0,
                                              l = checkSet.length;
                              Severity: Minor
                              Found in public/js/jquery.js - About 1 hr to fix

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

                                  d3.timer = function(callback, delay, then) {
                                    var found = false, t0, t1 = d3_timer_queue;
                                    if (arguments.length < 3) {
                                      if (arguments.length < 2) delay = 0; else if (!isFinite(delay)) return;
                                      then = Date.now();
                                Severity: Minor
                                Found in public/js/d3.v2.js - About 1 hr to fix

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

                                    d3.geo.albersUsa = function() {
                                      function albersUsa(coordinates) {
                                        var lon = coordinates[0], lat = coordinates[1];
                                        return (lat > 50 ? alaska : lon < -140 ? hawaii : lat < 21 ? puertoRico : lower48)(coordinates);
                                      }
                                  Severity: Minor
                                  Found in public/js/d3.v2.js - About 1 hr to fix

                                    Method graph has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def graph
                                        sip_hash = {}
                                        sips = get_sip_corpus(false)
                                        sips.each do |word|
                                          sip_hash[word] = who_has_sip(word)
                                    Severity: Minor
                                    Found in helpers.rb - About 1 hr to fix

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

                                        d3.geom.contour = function(grid, start) {
                                          var s = start || d3_geom_contourStart(grid), c = [], x = s[0], y = s[1], dx = 0, dy = 0, pdx = NaN, pdy = NaN, i = 0;
                                          do {
                                            i = 0;
                                            if (grid(x - 1, y - 1)) i += 1;
                                      Severity: Minor
                                      Found in public/js/d3.v2.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language