Showing 87 of 247 total issues
Function toString
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
toString(byteLength?: number, padding: boolean = true): string {
byteLength = byteLength ?? this._raw.byteLength;
const bytes = [];
for (const [, value] of this._raw.entries()) {
bytes.push(value);
Function _onOutput
has a Cognitive Complexity of 14 (exceeds 5 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) {
- 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 filterValue
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected filterValue<T extends number | Vector3>(object: DataObject, value: T, key = 'default'): Promise<T> {
return new Promise((resolve, reject) => {
// Get existing filter data
this.getNodeData(object)
.then(async (nodeData) => {
Function register
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function register() {
GraphShapeBuilder.registerShape(
'convertToSpace',
(space: ReferenceSpace) =>
new ReferenceSpaceConversionNode(space, {
Function convertAsObject
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
convertAsObject(
sourceObject: IndexedObject,
typeDescriptor: ConcreteTypeDescriptor,
memberName: string,
serializer: Serializer,
- 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 raw
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
get raw(): T {
if (this.calibrationData) {
if (this.value instanceof SensorValue) {
let result = this.value.clone() as SensorValue;
const offset = this.calibrationData.offset as unknown as SensorValue;
- 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 getLatestChanges
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
getLatestChanges(): Change[] {
// Get the changes per property
const changesPerProperty: { [key: string]: Change[] } = {};
this.changes.forEach((change) => {
if (!changesPerProperty[change.property]) {
Function push
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public push(data: In | In[], options?: PushOptions): Promise<void> {
return new Promise<void>((resolve, reject) => {
if (data === null || data === undefined) {
return reject();
}
Function convertAsSet
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
convertAsSet(
sourceObject: any,
typeDescriptor: SetTypeDescriptor,
knownTypes: Map<string, Serializable<any>>,
memberName: string,
Function _onPush
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private _onPush(frame: In | In[], options?: PushOptions): Promise<void> {
return new Promise<void>((resolve, reject) => {
const processPromises: Array<Promise<Out | Out[]>> = [];
if (Array.isArray(frame)) {
Function processObject
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
processObject(object: DataObject, frame: InOut): Promise<DataObject> {
return new Promise((resolve, reject) => {
// Get existing filter data
this.getNodeData(object)
.then(async (nodeData) => {
Function convertAsArray
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
convertAsArray(
sourceObject: any,
typeDescriptor: ArrayTypeDescriptor,
knownTypes: Map<string, Serializable<any>>,
memberName: string,
Function raw
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
set raw(value: T) {
if (this.calibrationData) {
if (value instanceof SensorValue) {
let result = value.clone() as SensorValue;
const offset = this.calibrationData.offset as unknown as SensorValue;
- 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 findByName
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected findByName(name: string): Unit | undefined {
// Check all aliases in those units
for (const alias of this.aliases.concat(this.name)) {
if (name === alias) {
// Exact match with alias
- 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 mergeFrame
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected mergeFrame(frame: DataFrame): Promise<DataFrame> {
return new Promise<DataFrame>((resolve, reject) => {
const defaultService = this.model.findDataService(DataObject);
const promises: Array<Promise<void>> = [];
const objects: DataObject[] = [];
Function _convertSingleValue
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private _convertSingleValue(
sourceObject: any,
typeDescriptor: TypeDescriptor,
memberName?: string,
memberOptions?: ObjectMemberMetadata,
Function process
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public process(frame: InOut, options?: PushOptions): Promise<InOut> {
return new Promise<InOut>((resolve) => {
if (this.options.maxCount === 1) {
return resolve(frame);
}
Function _convertSingleValue
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private _convertSingleValue(
sourceObject: any,
typeDescriptor: TypeDescriptor,
knownTypes: Map<string, Serializable<any>>,
memberName: string,
Function findAll
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public findAll(query?: FilterQuery<T>, options: FindOptions = {}): Promise<T[]> {
return new Promise<T[]>((resolve) => {
options.limit = options.limit || this._data.size;
let data: T[] = [];
this._data.forEach((object) => {
Function trilaterate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected trilaterate<P extends AbsolutePosition>(spheres: Array<Sphere<P>>): Promise<P> {
return new Promise<P>((resolve) => {
const maxIterations = this.options.maxIterations || 900;
const v = spheres.map((p) => p.center);
const ex = v[1].clone().sub(v[0]).normalize();