InsidersByte/honeymoon-gift-list

View on GitHub

Showing 36 of 276 total issues

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

      wrap(function* updateWeddingProfile(req, res) {
        req.checkBody('coverTitle').notEmpty();
        req.checkBody('coverImageUrl').isURL();
        req.checkBody('weddingDate').isDate();
        req.checkBody('giftListContent').notEmpty();
Severity: Minor
Found in server/routes/api/weddingProfile.js - About 1 hr to fix

    Function giftSetReducer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function giftSetReducer(state = giftSet, action) {
      switch (action.type) {
        case TYPES.LOAD_GIFT_SET_REQUEST:
          return Object.assign({}, state, { loading: true });
    
    
    Severity: Minor
    Found in public/reducers/giftSet.js - About 1 hr to fix

      Function giftsReducer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function giftsReducer(state = initialGifts, action) {
        switch (action.type) {
          case TYPES.OPEN_GIFT_MODAL:
            return Object.assign({}, state, { giftModalOpen: true });
      
      
      Severity: Minor
      Found in public/reducers/gifts.js - About 1 hr to fix

        Function exports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = ({ express, secure }) => {
          const router = new express.Router();
        
          router
            .route('/')
        Severity: Minor
        Found in server/routes/api/weddingPartyMember.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 exports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = ({ express, secure }) => {
          const router = new express.Router();
        
          router
            .route('/')
        Severity: Minor
        Found in server/routes/api/section.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 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            const { isAuthenticated, user, children, width } = this.props;
            const { navDrawerOpen } = this.state;
            let docked = false;
        
        
        Severity: Minor
        Found in public/containers/AdminLoggedIn.jsx - About 1 hr to fix

          Function createGiftSet has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                wrap(function* createGiftSet(req, res) {
                  req.checkBody('giver').notEmpty();
                  req.checkBody('giver.forename').notEmpty();
                  req.checkBody('giver.surname').notEmpty();
                  req.checkBody('giver.email').isEmail();
          Severity: Minor
          Found in server/routes/api/giftSet.js - About 1 hr to fix

            Function giftSetReducer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function giftSetReducer(state = giftSets, action) {
              switch (action.type) {
                case TYPES.LOAD_GIFT_SETS_REQUEST:
                  return Object.assign({}, state, { loading: true });
            
            
            Severity: Minor
            Found in public/reducers/giftSets.js - About 1 hr to fix

              Function authReducer has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function authReducer(state = auth, action) {
                switch (action.type) {
                  case TYPES.LOGIN_REQUEST:
                    return Object.assign({}, state, { saving: true });
              
              
              Severity: Minor
              Found in public/reducers/auth.js - About 1 hr to fix

                Function resetPassword has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    wrap(function* resetPassword(req, res) {
                      req.checkBody('token').equals(req.params.token);
                      req.checkBody('password', MINIMUM_PASSWORD_MESSAGE).isLength({ min: MINIMUM_PASSWORD_LENGTH });
                      req.checkBody('confirmPassword').equals(req.body.confirmPassword);
                
                
                Severity: Minor
                Found in server/routes/api/authenticate.js - About 1 hr to fix

                  Function authenticate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      wrap(function* authenticate(req, res) {
                        req.checkBody('email').isEmail();
                        req.checkBody('password').notEmpty();
                  
                        const errors = req.validationErrors();
                  Severity: Minor
                  Found in server/routes/api/authenticate.js - About 1 hr to fix

                    Function exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = ({ express, secure }) => {
                      const router = new express.Router();
                    
                      router
                        .route('/')
                    Severity: Minor
                    Found in server/routes/api/gift.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

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

                    const reducer = (state: BasketType = new Map(), action: ActionType): BasketType => {
                      switch (action.type) {
                        case ADD_TO_BASKET: {
                          const { payload: item } = action;
                          const { id } = item;
                    Severity: Minor
                    Found in public/redux/basket.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

                    Function createErrorNotifications has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const createErrorNotifications = ({ payload }): NotificationType | Array<NotificationType> => {
                      const notifications = [];
                    
                      if (payload.response && payload.response.body && (payload.response.body.message || payload.response.body.errors)) {
                        if (payload.response.body.message) {
                    Severity: Minor
                    Found in public/redux/notifications.js - About 35 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

                    Function move has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function move({ sourceId, targetId, data }) {
                      const items = [...data];
                      const sourceIndex = items.findIndex(o => o.id === sourceId);
                      const targetIndex = items.findIndex(o => o.id === targetId);
                      const movingUp = sourceIndex > targetIndex;
                    Severity: Minor
                    Found in public/utils/sortingHelper.js - About 35 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

                    Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = ({ express }) => {
                      const router = new express.Router();
                    
                      router
                        .route('/:token')
                    Severity: Minor
                    Found in server/routes/api/signUp.js - About 25 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

                    Severity
                    Category
                    Status
                    Source
                    Language