Showing 266 of 572 total issues
Function constructor
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(private readonly rootPlaceHolder: Element = null) {
this.onSourceCodeChanged = new Observable();
this.rootPlaceHolder = this.rootPlaceHolder || document.body;
this.mvx = new MVX(this.rootPlaceHolder);
ResultView
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
export class ResultView {
public readonly onSourceCodeChanged: Observable<ISourceCodeChangeEvent>;
private readonly mvx: MVX;
Function displayJSON
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private displayJSON(parentGroupId: number, json: any) {
if (json.VisualState) {
this.mvx.addChildState(parentGroupId, json.VisualState, this.jsonVisualStateItemComponent);
}
- 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 parseMTL
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
MTLFileLoader.prototype.parseMTL = function (scene, data, rootUrl) {
if (data instanceof ArrayBuffer) {
return;
}
//Split the lines from the file
Function init
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private init(): void {
if (!navigator.xr) {
return;
}
- 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 getJSONAsString
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private getJSONAsString(parentGroupId: number, key: string, json: any): string {
if (json === null) {
return "null";
}
- 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 compareGroups
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
private compareGroups(name: string, groupA: any, groupB: any): GroupComparisonResult {
// Prepare cache and result.
const processed: AlreadyProcessed = {};
const groupResult: GroupComparisonResult = {
name,
Function readFromContext
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected readFromContext(): void {
const program = this.context.getParameter(WebGlConstants.CURRENT_PROGRAM.value);
if (!program) {
return;
}
File sourceCodeComponent.ts
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
import preprocess from "@shaderfrog/glsl-parser/preprocessor"; // tslint:disable-line:no-submodule-imports
import { BaseComponent, IStateEvent } from "../../mvx/baseComponent";
import { ISourceCodeChangeEvent } from "../resultView";
import { Logger } from "../../../shared/utils/logger";
Function createCommands
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
private createCommands(capture: ICapture): void {
this.mvx.removeChildrenStates(this.commandListStateId);
let tempVisualStateId = this.initVisualStateId;
let visualStateSet = false;
Function refreshCanvases
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
var refreshCanvases = function() {
if (captureOffScreen) {
// List is retrieved from all the ever created canvases.
var myEvent = new CustomEvent("SpectorRequestCanvasListEvent");
document.dispatchEvent(myEvent);
- 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 render
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public render(state: ISourceCodeState, stateId: number): Element {
const source = state.fragment ? state.sourceFragment : state.sourceVertex;
let originalShader: string;
let preprocessed = state.preprocessed;
- 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 init
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
private init(): void {
if (!navigator.xr) {
return;
}
Function render
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public render(state: ICommandListItemState, stateId: number): Element {
const liHolder = document.createElement("li");
let status: string = "unknown";
switch (state.capture.status) {
case CommandCaptureStatus.Deprecated:
Function readUniformFromContext
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected readUniformFromContext(program: WebGLProgram, activeUniformIndex: number): {} {
const info = this.context.getActiveUniform(program, activeUniformIndex);
const location = this.context.getUniformLocation(program, info.name);
if (location) {
- 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 getTextureVisualState
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected getTextureVisualState(target: WebGlConstant, storage: WebGLTexture, info: ITextureRecorderData, pixelated: boolean): any {
try {
const gl = this.context;
const visual: any = {};
- 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 constructor
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(private readonly options: ICaptureMenuOptions = {}) {
this.rootPlaceHolder = options.rootPlaceHolder || document.body;
this.mvx = new MVX(this.rootPlaceHolder);
this.isTrackingCanvas = false;
Function getStackTrace
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static getStackTrace(removeFirstNCalls = 0, removeLastNCalls = 0): string[] {
const callstack: string[] = [];
try {
throw new Error("Errorator.");
Function update
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected update(functionInformation: IFunctionInformation, target: string, instance: WebGLTexture): number {
const customData = this.getCustomData(functionInformation, target, instance);
if (!customData) {
return 0;
}
- 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 createScene
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
var createScene = function (engine, canvas) {
var scene = new BABYLON.Scene(engine);
var camera = new BABYLON.ArcRotateCamera("camera1", 0, 0, 10, BABYLON.Vector3.Zero(), scene);