Showing 13 of 17 total issues
Function scrypt
has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring. Open
Open
function scrypt(password, salt, logN, r, dkLen, interruptStep, callback, encoding) {
'use strict';
function SHA256(m) {
/** @const */ var K = [
- 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 scrypt
has 358 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function scrypt(password, salt, logN, r, dkLen, interruptStep, callback, encoding) {
'use strict';
function SHA256(m) {
/** @const */ var K = [
Function exports
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
grunt.initConfig({
browserify: {
unittests: {
File scrypt-async.js
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* Fast "async" scrypt implementation in JavaScript.
* Copyright (c) 2013-2015 Dmitry Chestnykh | BSD License
* https://github.com/dchest/scrypt-async-js
*/
Function SHA256
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SHA256(m) {
/** @const */ var K = [
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,
0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,
0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,
Function salsaXOR
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function salsaXOR(tmp, B, bin, bout) {
var j0 = tmp[0] ^ B[bin++],
j1 = tmp[1] ^ B[bin++],
j2 = tmp[2] ^ B[bin++],
j3 = tmp[3] ^ B[bin++],
Function blocks
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function blocks(p) {
var off = 0, len = p.length;
while (len >= 64) {
var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7,
u, i, j, t1, t2;
Function PBKDF2_HMAC_SHA256_OneIter
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function PBKDF2_HMAC_SHA256_OneIter(password, salt, dkLen) {
// compress password if it's longer than hash block length
password = password.length <= 64 ? password : SHA256(password);
var i, innerLen = 64 + salt.length + 4,
Function scrypt
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function scrypt(password, salt, logN, r, dkLen, interruptStep, callback, encoding) {
Function blockMix
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function blockMix(tmp, B, bin, bout, r) {
Function blockXOR
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function blockXOR(dst, di, src, si, len) {
Function blockCopy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function blockCopy(dst, di, src, si, len) {
Function interruptedFor
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function interruptedFor(start, end, step, fn, donefn) {