glittershark/reactable

View on GitHub

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() {
Severity: Major
Found in tests/reactable_test.jsx - About 6 days to fix

    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';
    Severity: Minor
    Found in src/reactable/table.jsx - About 6 hrs to fix

      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';
      Severity: Major
      Found in src/reactable/table.jsx - About 5 hrs to fix

        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();
        Severity: Major
        Found in Gruntfile.js - About 4 hrs to fix

          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') {
          Severity: Minor
          Found in src/reactable/table.jsx - About 3 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

          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';
          Severity: Minor
          Found in src/reactable/table.jsx - About 3 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

          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 = [];
          
          
          Severity: Minor
          Found in src/reactable/table.jsx - About 3 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

          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') {
          Severity: Major
          Found in src/reactable/table.jsx - About 2 hrs to fix

            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];
            Severity: Major
            Found in src/reactable/thead.jsx - About 2 hrs to fix

              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];
              Severity: Minor
              Found in src/reactable/thead.jsx - About 1 hr 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 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');
                      }
              
              
              Severity: Minor
              Found in src/reactable/paginator.jsx - About 1 hr to fix

                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"
                Severity: Minor
                Found in tests/reactable_test.jsx - About 1 hr to fix

                  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') {
                  Severity: Minor
                  Found in src/reactable.jsx - About 1 hr 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 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];
                  Severity: Minor
                  Found in src/reactable/table.jsx - About 1 hr 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 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];
                  Severity: Minor
                  Found in src/reactable/table.jsx - About 1 hr 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 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"
                  Severity: Minor
                  Found in tests/reactable_test.jsx - About 1 hr to fix

                    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) {
                    Severity: Minor
                    Found in src/reactable/td.jsx - About 1 hr 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 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');
                            }
                    
                    
                    Severity: Minor
                    Found in src/reactable/paginator.jsx - About 1 hr 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 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') {
                    Severity: Minor
                    Found in src/reactable/table.jsx - About 1 hr to fix

                      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;
                      
                      
                      Severity: Minor
                      Found in src/reactable/table.jsx - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language