malmike/SMSApplication

View on GitHub

Showing 3 of 20 total issues

Function addContact has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  addContact(): express.Router{
    this.router.use(this.userAuthentication.userAuth);
    this.router.post('/addContact', async (req:IRequest, res:Response) => {
      const contactData = req.body as Contact;
      UserModel.findOne({
Severity: Minor
Found in src/routes/contacts/contact.router.ts - About 1 hr to fix

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

      userSignUp(): express.Router{
        this.router.post('/registerUser', async (req, res) => {
          const userData = req.body as User;
          UserModel.findOne({
            phone_number: userData.phone_number
    Severity: Minor
    Found in src/routes/authentication/user_registration.router.ts - About 1 hr to fix

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

        deleteContact(): express.Router{
          this.router.use(this.userAuthentication.userAuth);
          this.router.delete('/deleteContact/:phone_number', async (req:IRequest, res:Response) => {
            const contact = req.user.contacts.find(contact => contact.contact_phone_number === req.params.phone_number);
            if(!contact){
      Severity: Minor
      Found in src/routes/contacts/contact.router.ts - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language