OpenHPS/openhps-core

View on GitHub

Showing 247 of 247 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        return new Vector3(
            AngleUnit.RADIAN.convert(this.x, unit),
            AngleUnit.RADIAN.convert(this.y, unit),
            AngleUnit.RADIAN.convert(this.z, unit),
        );
Severity: Major
Found in src/utils/math/Euler.ts and 1 other location - About 1 hr to fix
src/data/position/GeographicalPosition.ts on lines 159..163

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                new Vector3(
                    LengthUnit.METER.convert(this.x, unit),
                    LengthUnit.METER.convert(this.y, unit),
                    LengthUnit.METER.convert(this.z, unit),
                ),
Severity: Major
Found in src/data/position/GeographicalPosition.ts and 1 other location - About 1 hr to fix
src/utils/math/Euler.ts on lines 66..70

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function processObject has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    processObject(object: DataObject): Promise<DataObject> {
        return new Promise((resolve, reject) => {
            const relativePositions = object.relativePositions
                // For each relative position matching the type
                .filter((x) => x instanceof this._relativePositionType);
Severity: Minor
Found in src/nodes/processing/dsp/RelativePositionFilter.ts - About 1 hr to fix

    Function addShape has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public addShape(shape: GraphBuilder<any, any> | GraphShape<any, any>): this {
            let graph: GraphShape<any, any>;
            if (shape instanceof GraphBuilder) {
                graph = shape.graph;
            } else {
    Severity: Minor
    Found in src/graph/builders/GraphBuilder.ts - About 1 hr to fix

      Similar blocks of code found in 6 locations. Consider refactoring.
      Open

          @SerializableMember({
              numberType: NumberType.DECIMAL,
          })
          get y(): number {
              if (!this.referenceValue) {
      Severity: Major
      Found in src/data/position/Relative2DPosition.ts and 5 other locations - About 1 hr to fix
      src/data/position/Absolute2DPosition.ts on lines 22..30
      src/data/position/Absolute2DPosition.ts on lines 39..47
      src/data/position/Absolute3DPosition.ts on lines 17..25
      src/data/position/Relative2DPosition.ts on lines 18..26
      src/data/position/Relative3DPosition.ts on lines 16..24

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 6 locations. Consider refactoring.
      Open

          @SerializableMember({
              numberType: NumberType.DECIMAL,
          })
          get x(): number {
              if (!this.vector) {
      Severity: Major
      Found in src/data/position/Absolute2DPosition.ts and 5 other locations - About 1 hr to fix
      src/data/position/Absolute2DPosition.ts on lines 39..47
      src/data/position/Absolute3DPosition.ts on lines 17..25
      src/data/position/Relative2DPosition.ts on lines 18..26
      src/data/position/Relative2DPosition.ts on lines 35..43
      src/data/position/Relative3DPosition.ts on lines 16..24

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 6 locations. Consider refactoring.
      Open

          @SerializableMember({
              numberType: NumberType.DECIMAL,
          })
          get z(): number {
              if (!this.referenceValue) {
      Severity: Major
      Found in src/data/position/Relative3DPosition.ts and 5 other locations - About 1 hr to fix
      src/data/position/Absolute2DPosition.ts on lines 22..30
      src/data/position/Absolute2DPosition.ts on lines 39..47
      src/data/position/Absolute3DPosition.ts on lines 17..25
      src/data/position/Relative2DPosition.ts on lines 18..26
      src/data/position/Relative2DPosition.ts on lines 35..43

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 6 locations. Consider refactoring.
      Open

          @SerializableMember({
              numberType: NumberType.DECIMAL,
          })
          get y(): number {
              if (!this.vector) {
      Severity: Major
      Found in src/data/position/Absolute2DPosition.ts and 5 other locations - About 1 hr to fix
      src/data/position/Absolute2DPosition.ts on lines 22..30
      src/data/position/Absolute3DPosition.ts on lines 17..25
      src/data/position/Relative2DPosition.ts on lines 18..26
      src/data/position/Relative2DPosition.ts on lines 35..43
      src/data/position/Relative3DPosition.ts on lines 16..24

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 6 locations. Consider refactoring.
      Open

          @SerializableMember({
              numberType: NumberType.DECIMAL,
          })
          get z(): number {
              if (!this.vector) {
      Severity: Major
      Found in src/data/position/Absolute3DPosition.ts and 5 other locations - About 1 hr to fix
      src/data/position/Absolute2DPosition.ts on lines 22..30
      src/data/position/Absolute2DPosition.ts on lines 39..47
      src/data/position/Relative2DPosition.ts on lines 18..26
      src/data/position/Relative2DPosition.ts on lines 35..43
      src/data/position/Relative3DPosition.ts on lines 16..24

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 6 locations. Consider refactoring.
      Open

          @SerializableMember({
              numberType: NumberType.DECIMAL,
          })
          get x(): number {
              if (!this.referenceValue) {
      Severity: Major
      Found in src/data/position/Relative2DPosition.ts and 5 other locations - About 1 hr to fix
      src/data/position/Absolute2DPosition.ts on lines 22..30
      src/data/position/Absolute2DPosition.ts on lines 39..47
      src/data/position/Absolute3DPosition.ts on lines 17..25
      src/data/position/Relative2DPosition.ts on lines 35..43
      src/data/position/Relative3DPosition.ts on lines 16..24

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              if ((typeDescriptor.keyType as any) == null) {
                  deserializer.getErrorHandler()(
                      new TypeError(`Could not deserialize ${memberName} as Map: missing key constructor.`),
                  );
                  return new Map<any, any>();
      Severity: Major
      Found in src/data/Deserializer.ts and 1 other location - About 1 hr to fix
      src/data/Deserializer.ts on lines 425..430

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              if ((typeDescriptor.valueType as any) == null) {
                  deserializer.getErrorHandler()(
                      new TypeError(`Could not deserialize ${memberName} as Map: missing value constructor.`),
                  );
                  return new Map<any, any>();
      Severity: Major
      Found in src/data/Deserializer.ts and 1 other location - About 1 hr to fix
      src/data/Deserializer.ts on lines 418..423

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function _onOutput has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private _onOutput(next: { id: string; success: boolean; result?: any }): void {
              if (this._promises.has(next.id)) {
                  const promise = this._promises.get(next.id);
                  if (next.success) {
                      if (next.result === undefined) {
      Severity: Minor
      Found in src/service/WorkerServiceProxy.ts - About 1 hr to fix

        Function _addServices has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private _addServices(services: any[], call: (call: WorkerServiceCall) => Promise<WorkerServiceResponse>): void {
                const model = this.model as ModelGraph<any, any>;
                services
                    .filter((service) => {
                        const internalService =
        Severity: Minor
        Found in src/worker/WorkerHandler.ts - About 1 hr to fix

          Function triangulate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected triangulate<P extends AbsolutePosition>(points: P[], angles: number[]): Promise<P> {
                  return new Promise<P>((resolve, reject) => {
                      const vectors = [points[0].toVector3(), points[1].toVector3(), points[2].toVector3()];
          
                      const x1 = vectors[0].x - vectors[1].x;
          Severity: Minor
          Found in src/nodes/processing/TriangulationNode.ts - About 1 hr to fix

            Function evaluateArraySelector has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected static evaluateArraySelector<T>(selector: string, value: any, subquery: QuerySelector<T>): boolean {
                    let result = true;
                    switch (selector) {
                        case '$in':
                            result = result && Array.from(value).includes(subquery[selector]);
            Severity: Minor
            Found in src/service/MemoryQueryEvaluator.ts - About 1 hr to fix

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                  static fromQuaternion(quat: Quaternion | THREE.Quaternion): Orientation {
                      return new Orientation(quat.x, quat.y, quat.z, quat.w);
                  }
              Severity: Major
              Found in src/data/position/Orientation.ts and 1 other location - About 1 hr to fix
              src/data/position/RelativeOrientation.ts on lines 33..35

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                  static fromQuaternion(quat: Quaternion | THREE.Quaternion): Orientation {
                      return new Orientation(quat.x, quat.y, quat.z, quat.w);
                  }
              Severity: Major
              Found in src/data/position/RelativeOrientation.ts and 1 other location - About 1 hr to fix
              src/data/position/Orientation.ts on lines 31..33

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                          this._services.forEach((service) => {
                              if (!service.isReady()) {
                                  buildPromises.push(service.emitAsync('build'));
                              }
                          });
              Severity: Major
              Found in src/graph/_internal/implementations/ModelGraph.ts and 1 other location - About 1 hr to fix
              src/graph/_internal/implementations/ModelGraph.ts on lines 82..86

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  public findAfter(timestamp: number, options?: FindOptions): Promise<T[]> {
                      return this._findTimestamp({ $gte: timestamp }, options);
                  }
              Severity: Major
              Found in src/service/DataFrameService.ts and 1 other location - About 1 hr to fix
              src/service/DataFrameService.ts on lines 30..32

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language