Skip to content

Refactoring code in src/controllers/accounts/follow.js #2

@aalmuhan

Description

@aalmuhan

This is from qlty smells --all --no-snippets
src/controllers/accounts/follow.js
21 Function with many parameters (count = 5): getFollow

I will be working on the following maintainability smell reported by Qlty in src/controllers/accounts/follow.js:
Function with many parameters (count = 5): getFollow
21 async function getFollow(tpl, name, req, res, next) {
node ➜ /workspaces/NodeBB (main) $ qlty smells src/controllers/accounts/follow.js
[0/3] 🔍 Analyzing 1 path... 0.00s
[1/3] 👀 Checking structure of 1 files... 0.32s
[2/3] 🤔 Looking for duplication across 1 files... 1.73s
[3/3] ✨ Reporting...

src/controllers/accounts/follow.js
Function with many parameters (count = 5): getFollow

      21  async function getFollow(tpl, name, req, res, next) {

The getFollow function currently takes five parameters. I will address this issue by refactoring the function.

Metadata

Metadata

Assignees

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