Showing 4 of 14 total issues
Function process
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
process(data: ImageFrame): Promise<ImageFrame> {
return new Promise<ImageFrame>((resolve, reject) => {
const boardSize = new Size(this.options.boardSize[0], this.options.boardSize[1]);
const criteria = new TermCriteria(termCriteria.EPS | termCriteria.MAX_ITER, 30, 0.001);
Function process
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
process(data: StereoImageFrame): Promise<StereoImageFrame> {
return new Promise<StereoImageFrame>((resolve, reject) => {
const boardSize = new Size(8, 6);
const promises = [];
promises.push(
Function play
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
play(): NodeJS.Timer {
let ready = true;
this._frame = 0;
this._timer = setInterval(
() => {
Function bundle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
const bundle = (env, module) => ({
name: PROJECT_NAME,
entry: `./dist/${module ? "esm" : "cjs"}/index.js`,
output: {
path: path.resolve(__dirname, 'dist'),
- 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"