tningjs/sam-and-his-friends

View on GitHub
src/utils/formatters/single-post-formatter.js

Summary

Maintainability
A
1 hr
Test Coverage

Function singlePostFormatter has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.singlePostFormatter = async function singlePostFormatter(postData) {
    const poster = await getActiveUserFromCache(postData.details.created_by.id);
    // Owner means the website owner who create article in index page
    const isPosterSiteOwner = username === poster.username.slice(1); // poster.username begins with `@`
    const { title, views, like_count: numLikes } = postData;
Severity: Minor
Found in src/utils/formatters/single-post-formatter.js - About 1 hr to fix

    There are no issues that match your filters.

    Category
    Status