codeforbtv/cvoeo-app

View on GitHub

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'
Severity: Minor
Found in models/goal.js - 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 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>
Severity: Minor
Found in components/login-form.js - About 1 hr to fix

    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,
    Severity: Minor
    Found in screens/dashboard/reducers.js - About 1 hr to fix

      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,
      Severity: Minor
      Found in screens/goal-details/reducers.js - About 1 hr to fix

        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'
        Severity: Minor
        Found in models/goal.js - About 1 hr to fix

          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;
          Severity: Minor
          Found in components/upcoming.js - 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 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')}`}
          Severity: Minor
          Found in components/goal-message-box/index.js - 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 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,
          Severity: Minor
          Found in components/app-state/reducers.js - About 1 hr to fix

            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,
            Severity: Minor
            Found in screens/login/reducers.js - About 1 hr to fix

              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;
              Severity: Minor
              Found in functions/index.js - About 55 mins 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

              Avoid deeply nested control flow statements.
              Open

                                switch (key) {
                                  case 'First Name':
                                    user.firstName = results.data[i][key];
                                    break;
                                  case 'Last Name':
              Severity: Major
              Found in functions/index.js - About 45 mins to fix

                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'
                Severity: Minor
                Found in models/user.js - About 45 mins 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

                Avoid deeply nested control flow statements.
                Open

                                    switch (key) {
                                      case 'Goal':
                                        goal.goaluid = results.data[i][key];
                                        break;
                                      case 'Goal Category':
                Severity: Major
                Found in functions/index.js - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language