app/assets/javascripts/tree_display.jsx
File tree_display.jsx
has 1392 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// initialize a global object available throughout the application
// can be useful on different pages
let app_variables = {
currentUserId: null,
Function render
has 321 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
var _rows = []
var _this = this
var colWidthArray = [ '30%', '0%', '0%', '0%', '25%', '25%', '20%' ]
var colDisplayStyle = {
Function render
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
var _rows = []
var _this = this
var colWidthArray = [ '30%', '0%', '0%', '0%', '25%', '25%', '20%' ]
var colDisplayStyle = {
Function render
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
var creation_date
var updated_date
var colWidthArray = [ '30%', '0%', '0%', '0%', '25%', '25%', '20%' ]
var colDisplayStyle = {
Function render
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
var creation_date
var updated_date
var colWidthArray = [ '30%', '0%', '0%', '0%', '25%', '25%', '20%' ]
var colDisplayStyle = {
Function render
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
var moreContent = []
var moreButtonStyle = {
display: '',
padding: '0 2px'
Function componentWillMount
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
componentWillMount: function() {
var _this = this
preloadImages(
'/assets/tree_view/edit-icon-24.png',
'/assets/tree_view/delete-icon-24.png',
Consider simplifying this complex logical expression. Open
Open
if (
((entry.name && entry.name.indexOf(_this.props.filterText) !== -1) ||
(entry.creation_date && entry.creation_date.indexOf(_this.props.filterText) !== -1) ||
(entry.institution && entry.institution.indexOf(_this.props.filterText) !== -1) ||
(entry.updated_date && entry.updated_date.indexOf(_this.props.filterText) !== -1)) &&
Consider simplifying this complex logical expression. Open
Open
if (
((entry.name && entry.name.indexOf(_this.props.filterText) !== -1) ||
(entry.creation_date &&
entry.creation_date.indexOf(_this.props.filterText) !== -1) ||
(entry.institution && entry.institution.indexOf(_this.props.filterText) !== -1) ||
Function getActions
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getActions: function(props) {
if (props.is_available) {
return node_attributes.assignment.actions.filter((i) => i(props)).map((val, i, arr) => {
let ret = val(props)
/** every five provide a break */
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
var colSpan = '5'
var colDisplayStyle = {
display: ''
}
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
var renderContent = []
var formStyle = {
margin: 0,
padding: 0,
Function handleUserClick
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleUserClick: function(colName, order) {
var tmpData = this.state.tableData
tmpData.sort(function(a, b) {
var a_val = eval('a.' + colName)
var b_val = eval('b.' + colName)
Function handleExpandClick
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleExpandClick: function(id, expanded, newParams) {
this.state.expandedRow.concat([ id ])
if (expanded) {
this.setState({
expandedRow: this.state.expandedRow.concat([ id ])
Consider simplifying this complex logical expression. Open
Open
if (
((entry.name && entry.name.indexOf(_this.props.filterText) !== -1) ||
(entry.creation_date &&
entry.creation_date.indexOf(_this.props.filterText) !== -1) ||
(entry.updated_date &&
Avoid deeply nested control flow statements. Open
Open
if (
((entry.name && entry.name.indexOf(_this.props.filterText) !== -1) ||
(entry.creation_date &&
entry.creation_date.indexOf(_this.props.filterText) !== -1) ||
(entry.updated_date &&
Avoid too many return
statements within this function. Open
Open
return 0
Avoid too many return
statements within this function. Open
Open
return a_val.localeCompare(b_val)
Avoid too many return
statements within this function. Open
Open
return 1
Avoid too many return
statements within this function. Open
Open
return -1