Showing 50 of 79 total issues
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return this._readEcmaArray();
Avoid too many return
statements within this function. Open
return this._readXmlDocument();
Avoid too many return
statements within this function. Open
return this._readStrictArray();
Avoid too many return
statements within this function. Open
return this._readDate();
Function readSamples
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static readSamples(fragment, source) {
// Collect entries
let entries = fragment.samples.map((sample, i) => {
return {
index: i,
- 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 _convertVideoSample
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_convertVideoSample(buffer, isKeyframe) {
let packetLength = 6 + buffer.length + (isKeyframe ? this._videoConfig.length : 0);
if (this._videoCodecInfo.type() === CodecUtils.CODEC_H265) {
packetLength++;
}
- 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 codec
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
codec() {
let profileIndication = this.extraData[1];
let generalTierFlag = ((profileIndication >> 5) & 1) === 1;
let generalCompatibilityFlags = this.extraData.readUInt32LE(2).toString(16).replace(/0+$/, '');
let generalLevel = this.extraData[12];
- 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"