Showing 49 of 62 total issues
Avoid deeply nested control flow statements. Open
Open
if (skin_err) {
callback(skin_err, null, slim);
} else {
skins.extract_face(img, facepath, function(err2) {
if (err2) {
Consider simplifying this complex logical expression. Open
Open
if (defname !== "steve" && defname !== "mhf_steve" && defname !== "alex" && defname !== "mhf_alex") {
if (helpers.id_valid(def)) {
// clean up the old URL to match new image
req.url.searchParams.delete('default');
req.url.path_list[2] = def;
Function store_skin
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function store_skin(rid, userId, profile, cache_details, callback) {
Function extract_helm
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
exp.extract_helm = function(rid, facefile, buffer, outname, callback) {
Function get_avatar
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
exp.get_avatar = function(rid, userId, overlay, size, callback) {
Function store_images
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function store_images(rid, userId, cache_details, type, callback) {
Function resume
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function resume(userId, type, err, hash, slim) {
Function store_cape
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function store_cape(rid, userId, profile, cache_details, callback) {
Function get_from_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
exp.get_from_options = function(rid, url, options, callback) {
var is_session_req = config.server.sessions_rate_limit && url.startsWith(session_url);
// This is to prevent being blocked by CloudFront for exceeding the rate limit
if (is_session_req && req_count() >= config.server.sessions_rate_limit) {
- 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"