Showing 18 of 102 total issues
File Dashboard.js
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react'
import './Dashboard.scss'
import Navbar from '../UI/Navbar/Navbar'
import Report from '../UI/Report/Report';
import BaseButton from '../UI/Button/BaseButton/BaseButton'
Function render
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(){
return (
<Fragment>
<HomeNavBar onConfirmOk={this.onConfirmOk} click={this.registerClick}/>
{this.state.newCompany ? this.showRegister() : null}
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="reports">
<Navbar />
<MenuButton/>
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let done = this.editConfirmationDone()
let error = this.editConfirmationError()
let receiptView = null
if (this.state.selectedReceipt) {
Function chooseContent
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const chooseContent = (props) => {
let text = null
let subText = null
switch(props.reportCase){
case 'reports':
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
moment.locale('pt-br')
return (
<div className="dashboard">
<Navbar/>
Function Login
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Login = (props) => {
if(props.registration === 'fail')
return <Confirmation content="Não foi possível logar, confira seus dados"
onConfirmOk={props.onConfirmOk}
Function build
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function build(previousFileSizes) {
console.log('Creating an optimized production build...');
let compiler = webpack(config);
return new Promise((resolve, reject) => {
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(){
if(this.state.smallDevice){
let styleSidebar = ["sidebar"]
if(this.state.isOpen)
styleSidebar.push('Open')
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let preview = null
if (this.props.filePDF !== null) {
preview = <embed className="pdf-preview" src={this.props.filePDF} type="application/pdf" width="290px" height="466px" />
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
let styleMenuButton = ["menubutton button"]
this.state.rotate ? styleMenuButton.push("rotate menubutton--open") : null
let styleOptions = ["options"]
Function reducer
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const reducer = (state = initialState, action) => {
switch(action.type) {
case actionTypes.ADD_PDF_FILE:
return {
...state,
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(){
const isLoggedIn = this.props.auth_token;
let buttonLogIN;
let buttonSignUp;
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
let preview = null
if (this.props.filePDF !== null) {
preview = <embed className="pdf-preview" src={this.props.filePDF} type="application/pdf" width="290px" height="466px" />
- 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 chooseContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const chooseContent = (props) => {
let text = null
let subText = null
switch(props.reportCase){
case 'reports':
- 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 BaseButton
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const BaseButton = (props) => {
let styles = ["base-button"]
if(props.type === 'confirm')
styles.push('confirm')
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
let content = this.ChooseScreen()
if(this.state.extraction)
content = <ReceiptCompare selectedTag={this.state.newTag} onCancelHandler={this.onCancelHandler} onConfirmButton={this.onConfirmButton} createCategory={this.createCategory} manual backDropDown={this.jumpExtraction}/>
- 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 Input
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Input = (props) => {
let styles = ["input-area__input"]
if(props.editable && props.valid)
styles.push("input-area__input--valid")
- 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"