junkurihara/jscu

View on GitHub
packages/js-crypto-hmac/src/hmac.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 2 of 2 total issues

Function compute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const compute = async (key: Uint8Array, data: Uint8Array, hash: HashTypes = 'SHA-256'): Promise<Uint8Array> => {
const env = util.getCrypto();
 
let msgKeyedHash;
let errMsg;
Severity: Minor
Found in packages/js-crypto-hmac/src/hmac.ts - About 1 hr to fix

Function compute has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const compute = async (key: Uint8Array, data: Uint8Array, hash: HashTypes = 'SHA-256'): Promise<Uint8Array> => {
const env = util.getCrypto();
 
let msgKeyedHash;
let errMsg;
Severity: Minor
Found in packages/js-crypto-hmac/src/hmac.ts - About 1 hr to fix

    There are no issues that match your filters.

    Category
    Status