OpenHPS/openhps-opencv

View on GitHub

Showing 4 of 14 total issues

Function process has 80 lines of code (exceeds 25 allowed). Consider refactoring.
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);

Severity: Major
Found in src/server/nodes/processing/CameraCalibrationNode.ts - About 3 hrs to fix

    Function process has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        process(data: StereoImageFrame): Promise<StereoImageFrame> {
            return new Promise<StereoImageFrame>((resolve, reject) => {
                const boardSize = new Size(8, 6);
                const promises = [];
                promises.push(
    Severity: Minor
    Found in src/server/nodes/processing/StereoCameraCalibrationNode.ts - About 1 hr to fix

      Function play has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          play(): NodeJS.Timer {
              let ready = true;
              this._frame = 0;
              this._timer = setInterval(
                  () => {
      Severity: Minor
      Found in src/common/nodes/source/AbstractVideoSource.ts - About 1 hr to fix

        Function bundle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        const bundle = (env, module) => ({
          name: PROJECT_NAME,
          entry: `./dist/${module ? "esm" : "cjs"}/index.js`,
          output: {
            path: path.resolve(__dirname, 'dist'),
        Severity: Minor
        Found in webpack.config.js - About 55 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language