dhgwilliam/google-voice-stats

View on GitHub

Showing 371 of 371 total issues

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

  function d3_scale_ordinal(domain, ranger) {
    function scale(x) {
      return range[((index.get(x) || index.set(x, domain.push(x))) - 1) % range.length];
    }
    function steps(start, step) {
Severity: Major
Found in public/js/d3.v2.js - About 2 hrs to fix

    Function doAnimation has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function doAnimation() {
                // XXX 'this' does not always have a nodeName when running the
                // test suite
    
                if ( optall.queue === false ) {
    Severity: Major
    Found in public/js/jquery.js - About 2 hrs to fix

      Function d3_svg_area has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function d3_svg_area(projection) {
          function area(data) {
            function segment() {
              segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z");
            }
      Severity: Major
      Found in public/js/d3.v2.js - About 2 hrs to fix

        Function add has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            add: function( elem, types, handler, data, selector ) {
        
                var elemData, eventHandle, events,
                    t, tns, type, namespaces, handleObj,
                    handleObjIn, quick, handlers, special;
        Severity: Major
        Found in public/js/jquery.js - About 2 hrs to fix

          Method person_by has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

            def person_by(person = nil, time_period = "month")
              messages = []
              unless person.nil?
                Message.find(:sent_by_id => person.id).union(:sent_to_id => person.id).each {|message| messages << message}
              else
          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

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

            function d3_time_parseMinutes(date, string, i) {
              d3_time_numberRe.lastIndex = 0;
              var n = d3_time_numberRe.exec(string.substring(i, i + 2));
              return n ? (date.M = +n[0], i += n[0].length) : -1;
            }
          Severity: Major
          Found in public/js/d3.v2.js and 5 other locations - About 2 hrs to fix
          public/js/d3.v2.js on lines 2379..2383
          public/js/d3.v2.js on lines 2397..2401
          public/js/d3.v2.js on lines 2402..2406
          public/js/d3.v2.js on lines 2412..2416
          public/js/d3.v2.js on lines 2417..2421

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

          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 6 locations. Consider refactoring.
          Open

            function d3_time_parseSeconds(date, string, i) {
              d3_time_numberRe.lastIndex = 0;
              var n = d3_time_numberRe.exec(string.substring(i, i + 2));
              return n ? (date.S = +n[0], i += n[0].length) : -1;
            }
          Severity: Major
          Found in public/js/d3.v2.js and 5 other locations - About 2 hrs to fix
          public/js/d3.v2.js on lines 2379..2383
          public/js/d3.v2.js on lines 2397..2401
          public/js/d3.v2.js on lines 2402..2406
          public/js/d3.v2.js on lines 2407..2411
          public/js/d3.v2.js on lines 2417..2421

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

          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 6 locations. Consider refactoring.
          Open

            function d3_time_parseDay(date, string, i) {
              d3_time_numberRe.lastIndex = 0;
              var n = d3_time_numberRe.exec(string.substring(i, i + 2));
              return n ? (date.d = +n[0], i += n[0].length) : -1;
            }
          Severity: Major
          Found in public/js/d3.v2.js and 5 other locations - About 2 hrs to fix
          public/js/d3.v2.js on lines 2379..2383
          public/js/d3.v2.js on lines 2402..2406
          public/js/d3.v2.js on lines 2407..2411
          public/js/d3.v2.js on lines 2412..2416
          public/js/d3.v2.js on lines 2417..2421

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

          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 6 locations. Consider refactoring.
          Open

            function d3_time_parseFullYear(date, string, i) {
              d3_time_numberRe.lastIndex = 0;
              var n = d3_time_numberRe.exec(string.substring(i, i + 4));
              return n ? (date.y = +n[0], i += n[0].length) : -1;
            }
          Severity: Major
          Found in public/js/d3.v2.js and 5 other locations - About 2 hrs to fix
          public/js/d3.v2.js on lines 2397..2401
          public/js/d3.v2.js on lines 2402..2406
          public/js/d3.v2.js on lines 2407..2411
          public/js/d3.v2.js on lines 2412..2416
          public/js/d3.v2.js on lines 2417..2421

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

          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 6 locations. Consider refactoring.
          Open

            function d3_time_parseMilliseconds(date, string, i) {
              d3_time_numberRe.lastIndex = 0;
              var n = d3_time_numberRe.exec(string.substring(i, i + 3));
              return n ? (date.L = +n[0], i += n[0].length) : -1;
            }
          Severity: Major
          Found in public/js/d3.v2.js and 5 other locations - About 2 hrs to fix
          public/js/d3.v2.js on lines 2379..2383
          public/js/d3.v2.js on lines 2397..2401
          public/js/d3.v2.js on lines 2402..2406
          public/js/d3.v2.js on lines 2407..2411
          public/js/d3.v2.js on lines 2412..2416

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

          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 6 locations. Consider refactoring.
          Open

            function d3_time_parseHour24(date, string, i) {
              d3_time_numberRe.lastIndex = 0;
              var n = d3_time_numberRe.exec(string.substring(i, i + 2));
              return n ? (date.H = +n[0], i += n[0].length) : -1;
            }
          Severity: Major
          Found in public/js/d3.v2.js and 5 other locations - About 2 hrs to fix
          public/js/d3.v2.js on lines 2379..2383
          public/js/d3.v2.js on lines 2397..2401
          public/js/d3.v2.js on lines 2407..2411
          public/js/d3.v2.js on lines 2412..2416
          public/js/d3.v2.js on lines 2417..2421

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

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

          Sizzle.filter = function( expr, set, inplace, not ) {
              var match, anyFound,
                  type, found, item, filter, left,
                  i, pass,
                  old = expr,
          Severity: Major
          Found in public/js/jquery.js - About 2 hrs to fix

            Function done has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function done( status, nativeStatusText, responses, headers ) {
            
                        // Called once
                        if ( state === 2 ) {
                            return;
            Severity: Major
            Found in public/js/jquery.js - About 2 hrs to fix

              Function init has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  init: function( selector, context, rootjQuery ) {
                      var match, elem, ret, doc;
              
                      // Handle $(""), $(null), or $(undefined)
                      if ( !selector ) {
              Severity: Major
              Found in public/js/jquery.js - About 2 hrs to fix

                Function hull has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  d3.geom.hull = function(vertices) {
                    if (vertices.length < 3) return [];
                    var len = vertices.length, plen = len - 1, points = [], stack = [], i, j, h = 0, x1, y1, x2, y2, u, v, a, sp;
                    for (i = 1; i < len; ++i) {
                      if (vertices[i][1] < vertices[h][1]) {
                Severity: Major
                Found in public/js/d3.v2.js - About 2 hrs to fix

                  Function relayout has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function relayout() {
                        var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;
                        chords = [];
                        groups = [];
                        k = 0, i = -1;
                  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

                          } else {
                            x1 = s1 ? s1.x : -1e6;
                            y1 = e.c - e.a * x1;
                            x2 = s2 ? s2.x : 1e6;
                            y2 = e.c - e.a * x2;
                    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 6556..6561

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

                    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

                      d3.text = function(url, mime, callback) {
                        function ready(req) {
                          callback(req && req.responseText);
                        }
                        if (arguments.length < 3) {
                    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 2961..2970

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

                    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

                      d3.xml = function(url, mime, callback) {
                        function ready(req) {
                          callback(req && req.responseXML);
                        }
                        if (arguments.length < 3) {
                    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 2936..2945

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

                    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

                          if (e.a === 1) {
                            y1 = s1 ? s1.y : -1e6;
                            x1 = e.c - e.b * y1;
                            y2 = s2 ? s2.y : 1e6;
                            x2 = e.c - e.b * y2;
                    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 6561..6566

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

                    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