Showing 107 of 107 total issues
Avoid too many return
statements within this function. Open
return {
status: "Good",
reason: `certificate chain is valid(length = ${certificateChain.length})`,
};
Avoid too many return
statements within this function. Open
return {
status: "BadCertificateInvalid",
reason: "subjectKeyIdentifier authorityKeyIdentifier in child certificate do not match subjectKeyIdentifier of parent certificate",
};
Function toPem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function toPem(raw_key: Buffer | string, pem: string): string {
assert(raw_key, "expecting a key");
assert(typeof pem === "string");
let pemType = identifyPemType(raw_key);
if (pemType) {
- 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 parseBitString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function parseBitString(buffer: Buffer, start: number, end: number, maxLength: number): string {
const unusedBit = buffer.readUInt8(start),
lenBit = ((end - start - 1) << 3) - unusedBit,
intro = "(" + lenBit + " bit)\n";
- 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 _coercePrivateKey
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function _coercePrivateKey(privateKey: any): Promise<KeyObject> {
const KeyObject = (crypto as any).KeyObject;
if (privateKey instanceof Buffer) {
const privateKey1 = await derToPrivateKey(privateKey); //
return KeyObject.from(privateKey1);
- 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
Parsing error: parser.parse is not a function Open
const { exploreCertificateInfo } = require("node-opcua-crypto");
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
HACK found Open
createVerify("RSA-SHA256").update("Hello**HACK**World").verify(alice_public_key, signature).should.equal(false);
- Exclude checks