Showing 33 of 83 total issues
Function constructor
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
constructor(args = {}) {
this.id = typeof args.id === 'string'
? args.id
: null;
this.parentGoalId = typeof args.parentGoalId === 'string'
- 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 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<View style={{marginBottom: 10, backgroundColor: '#04a0c6'}}>
<View>
<Text style={styles.label}>{'Username'}</Text>
Function reducers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function reducers(state = initialState.login, action) {
switch (action.type) {
case types.FETCH_GOALS_FAIL:
return {
...state,
Function reducers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function reducers(state = initialState.login, action) {
switch (action.type) {
case types.FETCH_GOALS_FAIL:
return {
...state,
Function constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(args = {}) {
this.id = typeof args.id === 'string'
? args.id
: null;
this.parentGoalId = typeof args.parentGoalId === 'string'
Function render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
let icon = icons.open;
if (this.state.expanded) {
icon = icons.close;
- 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 GoalMessageBox
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const GoalMessageBox = ({message, goal, gotoDetails, updateGoal}: Props) => (
<View style={styles.goalMessageBox}>
<View style={{alignSelf: 'flex-start'}}>
<Text style={styles.date}>
{!(goal && isValidDate(goal.goalDate)) ? null : `Due: ${moment(goal.goalDate).format('mm-dd-yyyy')}`}
- 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 reducers
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function reducers(state = initialState.loading, action) {
switch (action.type) {
case actions.INITIALIZATION_COMPLETED:
return {
...state,
Function reducers
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function reducers(state = initialState.login, action) {
switch (action.type) {
case types.LOGIN_SUCCESSFUL:
return {
...state,
Function pullDataFromLocalCSVFileTEST
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.pullDataFromLocalCSVFileTEST = functions.https.onRequest((request, response) => {
let fileContent="";
let pathToFile="";
let clientOrGoalCSV = "";
pathToFile = request.body.pathToFile;
- 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
Avoid deeply nested control flow statements. Open
switch (key) {
case 'First Name':
user.firstName = results.data[i][key];
break;
case 'Last Name':
Function constructor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
constructor(args = {}) {
this.uid = typeof args.uid === 'string' || typeof args.id === 'string'
? args.uid || args.id
: null;
this.displayName = typeof args.displayName === 'string'
- 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
Avoid deeply nested control flow statements. Open
switch (key) {
case 'Goal':
goal.goaluid = results.data[i][key];
break;
case 'Goal Category':