dhgwilliam/google-voice-stats

View on GitHub

Showing 371 of 371 total issues

Function d3_layout_packSiblings has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function d3_layout_packSiblings(node) {
    function bound(node) {
      xMin = Math.min(node.x - node.r, xMin);
      xMax = Math.max(node.x + node.r, xMax);
      yMin = Math.min(node.y - node.r, yMin);
Severity: Major
Found in public/js/d3.v2.js - About 2 hrs to fix

    Method graph has a Cognitive Complexity of 18 (exceeds 5 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 2 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

    Method build_dic has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

      def build_dic(person_id = nil, time_period = nil)
        unless person_id.nil? then dictionary = "dic_#{person_id}" else dictionary = "dic_all" end
        unless person_id.nil? then Ohm.redis.zremrangebyrank(dictionary, 0, -1)  end
        messages = {}
        unless person_id.nil?
    Severity: Minor
    Found in helpers.rb - About 2 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 d3_transition has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function d3_transition(groups, id, time) {
        d3_arraySubclass(groups, d3_transitionPrototype);
        var tweens = new d3_Map, event = d3.dispatch("start", "end"), ease = d3_transitionEase;
        groups.id = id;
        groups.time = time;
    Severity: Major
    Found in public/js/d3.v2.js - About 2 hrs to fix

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

          while (++i < n) {
            pi = points[i];
            px.shift();
            px.push(pi[0]);
            py.shift();
      Severity: Major
      Found in public/js/d3.v2.js and 1 other location - About 2 hrs to fix
      public/js/d3.v2.js on lines 1204..1211

      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 83.

      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

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

          while (++i < n) {
            pi = points[i];
            px.shift();
            px.push(pi[0]);
            py.shift();
      Severity: Major
      Found in public/js/d3.v2.js and 1 other location - About 2 hrs to fix
      public/js/d3.v2.js on lines 1176..1183

      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 83.

      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

            path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1];
      Severity: Major
      Found in public/js/d3.v2.js and 1 other location - About 2 hrs to fix
      public/js/d3.v2.js on lines 1158..1158

      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 83.

      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

      Function interpolateString has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        d3.interpolateString = function(a, b) {
          var m, i, j, s0 = 0, s1 = 0, s = [], q = [], n, o;
          d3_interpolate_number.lastIndex = 0;
          for (i = 0; m = d3_interpolate_number.exec(b); ++i) {
            if (m.index) s.push(b.substring(s0, s1 = m.index));
      Severity: Major
      Found in public/js/d3.v2.js - About 2 hrs to fix

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

              path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1];
        Severity: Major
        Found in public/js/d3.v2.js and 1 other location - About 2 hrs to fix
        public/js/d3.v2.js on lines 1141..1141

        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 83.

        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

        Function tick has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            force.tick = function() {
              if ((alpha *= .99) < .005) {
                event.end({
                  type: "end",
                  alpha: alpha = 0
        Severity: Major
        Found in public/js/d3.v2.js - About 2 hrs to fix

          Function hierarchy has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            d3.layout.hierarchy = function() {
              function recurse(data, depth, nodes) {
                var childs = children.call(hierarchy, data, depth), node = d3_layout_hierarchyInline ? data : {
                  data: data
                };
          Severity: Major
          Found in public/js/d3.v2.js - About 2 hrs to fix

            Function drag has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              d3.behavior.drag = function() {
                function drag() {
                  this.on("mousedown.drag", mousedown).on("touchstart.drag", mousedown);
                }
                function mousedown() {
            Severity: Major
            Found in public/js/d3.v2.js - About 2 hrs to fix

              Function ajaxConvert has 57 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function ajaxConvert( s, response ) {
              
                  // Apply the dataFilter if provided
                  if ( s.dataFilter ) {
                      response = s.dataFilter( response, s.dataType );
              Severity: Major
              Found in public/js/jquery.js - About 2 hrs to fix

                Function dispatch has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    dispatch: function( event ) {
                
                        // Make a writable jQuery.Event from the native event object
                        event = jQuery.event.fix( event || window.event );
                
                
                Severity: Major
                Found in public/js/jquery.js - About 2 hrs to fix

                  Function bind has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function bind(group, groupData) {
                        var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), n1 = Math.max(n, m), updateNodes = [], enterNodes = [], exitNodes = [], node, nodeData;
                        if (key) {
                          var nodeByKeyValue = new d3_Map, keyValues = [], keyValue, j = groupData.length;
                          for (i = -1; ++i < n; ) {
                  Severity: Major
                  Found in public/js/d3.v2.js - About 2 hrs to fix

                    Function format has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      d3.format = function(specifier) {
                        var match = d3_format_re.exec(specifier), fill = match[1] || " ", sign = match[3] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, suffix = "", integer = false;
                        if (precision) precision = +precision.substring(1);
                        if (zfill) {
                          fill = "0";
                    Severity: Major
                    Found in public/js/d3.v2.js - About 2 hrs to fix

                      Function quadtree has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        d3.geom.quadtree = function(points, x1, y1, x2, y2) {
                          function insert(n, p, x1, y1, x2, y2) {
                            if (isNaN(p.x) || isNaN(p.y)) return;
                            if (n.leaf) {
                              var v = n.point;
                      Severity: Major
                      Found in public/js/d3.v2.js - About 2 hrs to fix

                        Function data has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            data: function( elem, name, data, pvt /* Internal Use Only */ ) {
                                if ( !jQuery.acceptData( elem ) ) {
                                    return;
                                }
                        
                        
                        Severity: Major
                        Found in public/js/jquery.js - About 2 hrs to fix

                          Function offset has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              jQuery.fn.offset = function( options ) {
                                  var elem = this[0];
                          
                                  if ( options ) {
                                      return this.each(function( i ) {
                          Severity: Major
                          Found in public/js/jquery.js - About 2 hrs to fix

                            Function removeData has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                removeData: function( elem, name, pvt /* Internal Use Only */ ) {
                                    if ( !jQuery.acceptData( elem ) ) {
                                        return;
                                    }
                            
                            
                            Severity: Major
                            Found in public/js/jquery.js - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language