Skip to content

P1B: Refactor (src/controllers/user.js): Function with high complexity (count = 10): getUserDataByField #55

@FaizFarooqMoazam

Description

@FaizFarooqMoazam

Uniqueness check

  • I have searched open issues and confirmed this file + smell is not already taken.

Full path to the JavaScript file

src/controllers/user.js

Function(s)/scope targeted

getUserDataByField

Relevant Qlty output

Function with high complexity (count = 10): getUserDataByField

          38  userController.getUserDataByField = async function (callerUid, field, fieldValue) {
          39    let uid = null;
          40    if (field === 'uid') {
          41            uid = fieldValue;
          42    } else if (field === 'username') {
          43            uid = await user.getUidByUsername(fieldValue);
              [hid 15 additional lines]

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions