Showing 72 of 286 total issues
Function AudioFingerprintRuntime
has a Cognitive Complexity of 521 (exceeds 5 allowed). Consider refactoring. Open
let AudioFingerprintRuntime = (() => {
var n, o = void 0 !== o ? o : {},i = {};
for (n in o)
o.hasOwnProperty(n) && (i[n] = o[n]);
var read_, readAsync, readBinary, c, f, l = [],
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function AudioFingerprintRuntime
has 1546 lines of code (exceeds 25 allowed). Consider refactoring. Open
let AudioFingerprintRuntime = (() => {
var n, o = void 0 !== o ? o : {},i = {};
for (n in o)
o.hasOwnProperty(n) && (i[n] = o[n]);
var read_, readAsync, readBinary, c, f, l = [],
File afp.js
has 1567 lines of code (exceeds 250 allowed). Consider refactoring. Open
// https://fn.music.163.com/g/chrome-extension-home-page-beta/
let AudioFingerprintRuntime = (() => {
var n, o = void 0 !== o ? o : {},i = {};
for (n in o)
o.hasOwnProperty(n) && (i[n] = o[n]);
Function ApiCache
has a Cognitive Complexity of 191 (exceeds 5 allowed). Consider refactoring. Open
function ApiCache() {
var memCache = new MemoryCache()
var globalOptions = {
debug: false,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function ApiCache
has 576 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ApiCache() {
var memCache = new MemoryCache()
var globalOptions = {
debug: false,
File apicache.js
has 608 lines of code (exceeds 250 allowed). Consider refactoring. Open
var url = require('url')
var MemoryCache = require('./memory-cache')
var t = {
ms: 1,
Function createRequest
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
const createRequest = (method, url, data = {}, options) => {
return new Promise((resolve, reject) => {
let headers = { 'User-Agent': chooseUserAgent(options.ua) }
options.headers = options.headers || {}
headers = {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function cache
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.middleware = function cache(
strDuration,
middlewareToggle,
localOptions,
) {
Function createRequest
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createRequest = (method, url, data = {}, options) => {
return new Promise((resolve, reject) => {
let headers = { 'User-Agent': chooseUserAgent(options.ua) }
options.headers = options.headers || {}
headers = {
Function exports
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async (query, request) => {
let ext = 'mp3'
if (query.songFile.name.indexOf('flac') > -1) {
ext = 'flac'
}
Function exports
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async (query, request) => {
let ext = 'mp3'
if (query.songFile.name.indexOf('flac') > -1) {
ext = 'flac'
}
Function consturctServer
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function consturctServer(moduleDefs) {
const app = express()
const { CORS_ALLOW_ORIGIN } = process.env
app.set('trust proxy', true)
Function cache
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
var cache = function (req, res, next) {
function bypass() {
debug('bypass detected, skipping cache.')
return next()
}
Function ke
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
ke = (function() {
var import_table = {
a: import_table_impl
};
Function clear
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.clear = function (target, isAutomatic) {
var group = index.groups[target]
var redis = globalOptions.redisClient
if (group) {
Function CachePerformance
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function CachePerformance() {
/**
* Tracks the hit rate for the last 100 requests.
* If there have been fewer than 100 requests, the hit rate just considers the requests that have happened.
*/
Function k
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
k: function(t, e) {
var r = "std::string" === (e = ct(e));
_t(t, {
name: e,
fromWireType: function(t) {
Function makeResponseCacheable
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeResponseCacheable(
req,
res,
next,
key,
Function exports
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async (query, request) => {
// query.cookie.os = 'pc'
const tracks = query.tracks.split(',')
const data = {
op: query.op, // del,add
Function ExceptionInfo
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ExceptionInfo(excPtr) {
this.excPtr = excPtr,
this.ptr = excPtr - 16,
this.set_type = function(t) {
j[this.ptr + 4 >> 2] = t