Showing 266 of 572 total issues
Function _beautify
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private _beautify(glsl: string, level: number = 0): string {
let spaces = "";
for (let i = 0; i < level; i++) {
spaces += " "; // 4 spaces
}
- 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 a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private init(): void {
// Needs both this.
// tslint:disable-next-line
const self = this;
- 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 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected getTextureVisualState(target: WebGlConstant, storage: WebGLTexture, info: ITextureRecorderData, pixelated: boolean): any {
try {
const gl = this.context;
const visual: any = {};
Function getCapture
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected getCapture(gl: WebGLRenderingContext, name: string, x: number, y: number, width: number, height: number,
textureCubeMapFace: number, textureLayer: number, type: number) {
width = Math.floor(width);
height = Math.floor(height);
Function initializeByteSizeFormat
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static initializeByteSizeFormat(): void {
if (this.byteSizePerInternalFormat) {
return;
}
Function Loader
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Loader = (function () {
var useDist;
var queue;
var callback;
Function readFrameBufferAttachmentFromContext
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected readFrameBufferAttachmentFromContext(attachment: number): any {
const target = WebGlConstants.FRAMEBUFFER.value;
const type = this.context.getFramebufferAttachmentParameter(target, attachment, WebGlConstants.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE.value);
if (type === WebGlConstants.NONE.value) {
return 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 ensure4x4
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Matrix.prototype.ensure4x4 = function()
{
if (this.elements.length == 4 &&
this.elements[0].length == 4)
return this;
- 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 getChangeCommandsByState
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected getChangeCommandsByState(): { [key: string]: string[] } {
this.parameters = [];
this.parameters.push(this.getWebgl1Parameters());
if (this.contextVersion > 1) {
this.parameters.push(this.getWebgl2Parameters());
- 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 getCapture
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected getCapture(gl: WebGLRenderingContext, name: string, x: number, y: number, width: number, height: number,
textureCubeMapFace: number, textureLayer: number, type: number) {
width = Math.floor(width);
height = Math.floor(height);
- 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 getCapture
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected getCapture(gl: WebGLRenderingContext, x: number, y: number, width: number, height: number, type: number, pixelated: boolean): string {
width = Math.floor(width);
height = Math.floor(height);
try {
Function createScene
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var createScene = function (engine, canvas) {
var scene = new BABYLON.Scene(engine);
//Create a light
var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(-60, 60, 80), scene);
Function createScene
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var createScene = function (engine, canvas) {
var scene = new BABYLON.Scene(engine);
//Create a light
var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(-60, 60, 80), scene);
Function readUniformFromContext
has 50 lines of code (exceeds 25 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) {
Consider simplifying this complex logical expression. Open
if (internalFormat !== WebGlConstants.RGB.value &&
internalFormat !== WebGlConstants.RGBA.value &&
internalFormat !== WebGlConstants.RGBA8.value &&
internalFormat !== WebGlConstants.RGBA16F.value &&
internalFormat !== WebGlConstants.RGBA32F.value &&
Function readFrameBufferAttachmentFromRenderBuffer
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected readFrameBufferAttachmentFromRenderBuffer(gl: WebGLRenderingContext | WebGL2RenderingContext,
frameBuffer: WebGLFramebuffer, webglConstant: WebGlConstant,
x: number, y: number, width: number, height: number,
target: number, componentType: number, storage: any): void {
Function _beautify
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private _beautify(glsl: string, level: number = 0): string {
let spaces = "";
for (let i = 0; i < level; i++) {
spaces += " "; // 4 spaces
}
Function getJSONAsString
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private getJSONAsString(parentGroupId: number, key: string, json: any): string {
if (json === null) {
return "null";
}
Function executeFunction
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static executeFunction(object: any, functionName: string, args: IArguments) {
const a = args;
if (a === undefined || a.length === 0) {
return object[functionName]();
}
Function serializeCapture
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function serializeCapture(capture) {
var commands = capture.commands;
capture.commands = [];
var serializedCapture;
- 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"