reimandlab/needleplot

View on GitHub

Showing 12 of 12 total issues

Function NeedlePlot has 581 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var NeedlePlot = function(configuration)
{
    var svg, zoom, vis, vertical_scalable, unit
    var scale = 1
    var position = 0
Severity: Major
Found in needleplot.js - About 2 days to fix

    File needleplot.js has 623 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Simplified, shallow equivalent of jquery.extend
     * @private
     * @param modified_obj
     * @param modifying_obj
    Severity: Major
    Found in needleplot.js - About 1 day to fix

      Function NeedlePlot has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
      Open

      var NeedlePlot = function(configuration)
      {
          var svg, zoom, vis, vertical_scalable, unit
          var scale = 1
          var position = 0
      Severity: Minor
      Found in needleplot.js - About 1 day 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 create_needles has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function create_needles(vis, needle_tooltip)
          {
              var needles = vis.selectAll('.needle')
                  .data(
                      config.data.mutations
      Severity: Major
      Found in needleplot.js - About 3 hrs to fix

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

            var create_plot = function()
            {
                zoom = prepare_zoom(config.min_zoom, config.max_zoom, zoomAndMove)
        
                svg = prepare_svg(config.element)
        Severity: Major
        Found in needleplot.js - About 2 hrs to fix

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

              function create_axes()
              {
                  if(config.use_log)
                  {
                      axes.y.scale = d3.scale.log()
          Severity: Major
          Found in needleplot.js - About 2 hrs to fix

            Function _rescale_plot has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var _rescale_plot = function()
                {
                    svg
                        .attr('viewBox', '0 0 ' + config.width + ' ' + config.height)
            
            
            Severity: Minor
            Found in needleplot.js - About 1 hr to fix

              Function Axis has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var Axis = function()
                  {
                      this.scale = null
                      this.group = null
                      this.obj = null
              Severity: Minor
              Found in needleplot.js - About 1 hr to fix

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

                    var adjust_content = function(animate)
                    {
                        if(scale === config.max_zoom)
                        {
                            changeTicksCount(20)
                Severity: Minor
                Found in needleplot.js - About 1 hr to fix

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

                  var MinimalTooltip = function(tooltip_config)
                  {
                      var self = this
                  
                      this.moveToPointer = function(){
                  Severity: Minor
                  Found in needleplot.js - About 1 hr to fix

                    Function _setZoomAndMove has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        var _setZoomAndMove = function(new_scale, new_position, stop_callback, stop_animation, recalculate_position)
                    Severity: Minor
                    Found in needleplot.js - About 35 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return d3.format('%')(d)
                      Severity: Major
                      Found in needleplot.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language