Showing 12 of 12 total issues
Function NeedlePlot
has 581 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var NeedlePlot = function(configuration)
{
var svg, zoom, vis, vertical_scalable, unit
var scale = 1
var position = 0
File needleplot.js
has 623 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Simplified, shallow equivalent of jquery.extend
* @private
* @param modified_obj
* @param modifying_obj
Function NeedlePlot
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
Open
var NeedlePlot = function(configuration)
{
var svg, zoom, vis, vertical_scalable, unit
var scale = 1
var position = 0
- Read upRead up
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
Open
function create_needles(vis, needle_tooltip)
{
var needles = vis.selectAll('.needle')
.data(
config.data.mutations
Function create_plot
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var create_plot = function()
{
zoom = prepare_zoom(config.min_zoom, config.max_zoom, zoomAndMove)
svg = prepare_svg(config.element)
Function create_axes
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function create_axes()
{
if(config.use_log)
{
axes.y.scale = d3.scale.log()
Function _rescale_plot
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _rescale_plot = function()
{
svg
.attr('viewBox', '0 0 ' + config.width + ' ' + config.height)
Function Axis
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Axis = function()
{
this.scale = null
this.group = null
this.obj = null
Function adjust_content
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var adjust_content = function(animate)
{
if(scale === config.max_zoom)
{
changeTicksCount(20)
Function MinimalTooltip
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var MinimalTooltip = function(tooltip_config)
{
var self = this
this.moveToPointer = function(){
Function _setZoomAndMove
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var _setZoomAndMove = function(new_scale, new_position, stop_callback, stop_animation, recalculate_position)
Avoid too many return
statements within this function. Open
Open
return d3.format('%')(d)