cnap-cobre/synapse

View on GitHub
frontend/src/components/FileBrowserGrid/FileBrowserGrid.js

Summary

Maintainability
C
1 day
Test Coverage

Showing 5 of 5 total issues

Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

render() {
const folders = this.props.list.filter(
(item, i) => ((this.props.showDotfiles || !item.name.match(/^\./i)) && item.type === 'dir'),
);
 
 
Severity: Minor
Found in frontend/src/components/FileBrowserGrid/FileBrowserGrid.js - About 1 hr to fix

    Function render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    render() {
    const folders = this.props.list.filter(
    (item, i) => ((this.props.showDotfiles || !item.name.match(/^\./i)) && item.type === 'dir'),
    );
     
     
    Severity: Minor
    Found in frontend/src/components/FileBrowserGrid/FileBrowserGrid.js - About 45 mins to fix

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    static propTypes = {
    showDotfiles: PropTypes.bool.isRequired,
    error: PropTypes.bool.isRequired,
    loading: PropTypes.bool.isRequired,
    list: PropTypes.array.isRequired,
    Severity: Major
    Found in frontend/src/components/FileBrowserGrid/FileBrowserGrid.js and 1 other location - About 2 hrs to fix
    frontend/src/components/FileBrowserList/FileBrowserList.js on lines 8..17

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    <Col xs={12} className="fileGridFlexContainer">
    {allComponents.filter(c => c.props.file.type === 'file')}
    {Array.from(Array(9).keys()).map(i => (<div className="fileGridPlaceholder" key={i} />))}
    </Col>
    Severity: Major
    Found in frontend/src/components/FileBrowserGrid/FileBrowserGrid.js and 1 other location - About 1 hr to fix
    frontend/src/components/FileBrowserGrid/FileBrowserGrid.js on lines 77..80

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    <Col xs={12} className="fileGridFlexContainer">
    {allComponents.filter(c => c.props.file.type === 'dir')}
    {Array.from(Array(9).keys()).map(i => (<div className="fileGridPlaceholder" key={i} />))}
    </Col>
    Severity: Major
    Found in frontend/src/components/FileBrowserGrid/FileBrowserGrid.js and 1 other location - About 1 hr to fix
    frontend/src/components/FileBrowserGrid/FileBrowserGrid.js on lines 89..92
    Category
    Status