NodeBB/NodeBB

View on GitHub
public/src/utils.common.js

Summary

Maintainability
C
1 day
Test Coverage

File utils.common.js has 635 lines of code (exceeds 500 allowed). Consider refactoring.
Open

'use strict';


// add default escape function for escaping HTML entities
const escapeCharMap = Object.freeze({
Severity: Major
Found in public/src/utils.common.js - About 5 hrs to fix

    utils has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

    const utils = {
        // https://github.com/substack/node-ent/blob/master/index.js
        decodeHTMLEntities: function (html) {
            return String(html)
                .replace(/&#(\d+);?/g, function (_, code) {
    Severity: Minor
    Found in public/src/utils.common.js - About 5 hrs to fix

      Avoid too many return statements within this function.
      Open

              return str;
      Severity: Major
      Found in public/src/utils.common.js - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status