Showing 107 of 240 total issues
Function exports
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function() {
describe('sparkline widget creation', () => {
let widget;
let data = [
[
Function convertDataForHero
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function convertDataForHero(_data, _range) {
let data = _data;
let range = _range || 13;
if (data && data.length) {
data = data.filter(d => d.data && d.data.length);
- 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
Method create
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def create(options={}, &block)
@generate_hero = params[:dashboard].delete :generate_hero
if params.dig(:dashboard, :notes).present?
begin
- 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 groupWidgetsToColumns
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const groupWidgetsToColumns = (widgets, viewport) => {
let colsNum;
if (viewport === 'sm') {
colsNum = 1;
- 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
Method create
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create(options={}, &block)
@generate_hero = params[:dashboard].delete :generate_hero
if params.dig(:dashboard, :notes).present?
begin
Function transformDataForCartesian
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const transformDataForCartesian = (config, slices) => {
// single category - slices.length === 1
// single section - slices[0].groups.length === 1
// single category - slices.length === 1
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
this.date = this.container
.append('div')
.attr('class', 'date')
.attr('style', 'display:none')
Method create_full
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_full
data_table = DataTable.create({
:dashboard_id => @dashboard.id,
:options => {
:period => params[:interval], # year, week, customn
Function formatSeconds
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const formatSeconds = function(value) {
let second = 0;
let minute = '';
let hour = '';
- 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 init
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
init() {
super.init();
let that = this;
let lastIndex = this.chart.data[0].length - 1;
this.hover(lastIndex);
- 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 mapStateToProps
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapStateToProps = (state, ownProps) => {
const { currentNormalizedSlice } = ownProps;
if (!currentNormalizedSlice) {
return {
Function Footer
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Footer = () => {
return (
<footer className="main__footer">
<div className="govau-footer">
<div className="container">
Function Field
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Field = props => {
const {
id,
classNames,
label,
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
render({ formProps, formData }) {
if (!formProps) {
throw new Error('must provide formProps to base form');
}
Method call
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
config = DashboardCool::Application.config.action_controller
if config.perform_caching
unless env['PATH_INFO'] =~ /^\/assets\//
- 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 cartesianMultipleCategorySingleSeries
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const cartesianMultipleCategorySingleSeries = (config, slices) => {
const position = slices[0].widget.pos;
const getColor =
config._isKpi === true
? makeGetKpiColorset()
- 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 init
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
init() {
super.init();
this.svg.select('g.chart__wrapper').each(function(_data) {
// add rulers
d3.select(this)
Function init
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
init() {
super.init();
let that = this;
let lastIndex = this.chart.data[0].length - 1;
this.hover(lastIndex);
Function tryApplyUpdates
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function tryApplyUpdates(onHotUpdateSuccess) {
if (!module.hot) {
// HotModuleReplacementPlugin is not in Webpack configuration.
window.location.reload();
return;
- 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 getWidgetType
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const getWidgetType = widget => {
const { type, options } = widget;
if (type === 'fact') {
return 'fact';
- 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"