Showing 30 of 183 total issues
File reactable_test.jsx
has 2261 lines of code (exceeds 250 allowed). Consider refactoring. Open
var ReactTestUtils = React.addons.TestUtils;
var expect = chai.expect;
var ReactableTestUtils = {
resetTestEnvironment: function() {
File table.jsx
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { filterPropsFrom } from './lib/filter_props_from';
import { extractDataFrom } from './lib/extract_data_from';
import { isUnsafe } from './unsafe';
import { Thead } from './thead';
Function render
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let children = [];
let columns;
let userColumnsSpecified = false;
let showHeaders = typeof this.props.hideTableHeader === 'undefined';
Function exports
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.registerMultiTask('markdownlint', function task() {
var done = this.async();
Function getCurrentSort
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
getCurrentSort(column) {
let columnName, sortDirection;
if (column instanceof Object) {
if (typeof(column.column) !== 'undefined') {
- 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 render
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
render() {
let children = [];
let columns;
let userColumnsSpecified = false;
let showHeaders = typeof this.props.hideTableHeader === 'undefined';
- 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 applyFilter
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
applyFilter(filter, children) {
// Helper function to apply filter text to a list of table rows
filter = filter.toLowerCase();
let matchedChildren = [];
- 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 parseChildData
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseChildData(props) {
let data = [], tfoot;
// Transform any children back to a data array
if (typeof(props.children) !== 'undefined') {
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
// Declare the list of Ths
var Ths = [];
for (var index = 0; index < this.props.columns.length; index++) {
var column = this.props.columns[index];
Function render
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
render() {
// Declare the list of Ths
var Ths = [];
for (var index = 0; index < this.props.columns.length; index++) {
var column = this.props.columns[index];
- 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 render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (typeof this.props.colSpan === 'undefined') {
throw new TypeError('Must pass a colSpan argument to Paginator');
}
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
return (
<div>
<input type="text" ref="customFilterInput" id="customFilterInput" value={this.state.customFilterText} onChange={this.handleChange}/>
<Reactable.Table className="table" id="table"
Function value
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
value: function(predicate) {
if (this === null) {
throw new TypeError('Array.prototype.find called on null or undefined');
}
if (typeof predicate !== 'function') {
- 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 initializeSorts
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
initializeSorts(props) {
this._sortable = {};
// Transform sortable properties into a more friendly list
for (let i in props.sortable) {
let column = props.sortable[i];
- 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 initializeFilters
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
initializeFilters(props) {
this._filterable = {};
// Transform filterable properties into a more friendly list
for (let i in props.filterable) {
let column = props.filterable[i];
- 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 render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
return (
<div>
<input type="text" ref="customFilterInput" id="customFilterInput" value={this.state.customFilterText} onChange={this.handleChange}/>
<Reactable.Table className="table" id="table"
Function render
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
// Attach any properties on the column to this Td object to allow things like custom event handlers
var mergedProps = filterPropsFrom(this.props);
if (typeof(this.props.column) === 'object') {
for (var key in this.props.column) {
- 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 render
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (typeof this.props.colSpan === 'undefined') {
throw new TypeError('Must pass a colSpan argument to Paginator');
}
- 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 getCurrentSort
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
getCurrentSort(column) {
let columnName, sortDirection;
if (column instanceof Object) {
if (typeof(column.column) !== 'undefined') {
Function sortByCurrentSort
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
sortByCurrentSort() {
// Apply a sort function according to the current sort in the state.
// This allows us to perform a default sort even on a non sortable column.
let currentSort = this.state.currentSort;