Showing 17 of 37 total issues
Dot
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
export class Dot {
//
// ─── GLOBALS ─────────────────────────────────────────────────────
//
Function BFS
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function BFS ( start: Dot, steps: number ) {
let bfs = new Array<Array<Dot>>( );
let checked = new Array<Boolean>( );
for ( let it = 0; it < KaryGraph.Dot.TotalDots; it++ ) {
- 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 Tree
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Tree ( ): boolean {
// vars
var map = new Map( );
var keys = Object.keys( Storage.Nodes );
Function Tree
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function Tree ( ): boolean {
// vars
var map = new Map( );
var keys = Object.keys( Storage.Nodes );
- 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 RenderSpiral
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function RenderSpiral ( ) {
//
// ─── ENUMS ───────────────────────────────────────────────────────
//
Function GenerateSomeRandomNodes
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function GenerateSomeRandomNodes ( howManyNodes: number ) {
// defs
const baseUnit = 120;
const widthUnit = Math.floor( GraphWidth / baseUnit );
const heightUnit = Math.floor( GraphHeight / baseUnit );
Function graphfrommatrix
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function graphfrommatrix ( matrix: number[][] ) {
var numberOfNodes = matrix.length;
for ( var i = 0; i < numberOfNodes; i++ ) {
if ( matrix[ i ].length != numberOfNodes ) {
// KaryGraph.UI.Console.PrintError( "Invalid matrix." );
- 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 GraphInitMonacoOnStart
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GraphInitMonacoOnStart ( ) {
function uriFromPath ( _path ) {
var pathName = path.resolve( _path ).replace( /\\/g, '/' );
if ( pathName.length > 0 && pathName.charAt( 0 ) !== '/' ) {
Function BFS
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function BFS ( start: Dot, steps: number ) {
let bfs = new Array<Array<Dot>>( );
let checked = new Array<Boolean>( );
for ( let it = 0; it < KaryGraph.Dot.TotalDots; it++ ) {
Function OnPromptArrowsClicked
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function OnPromptArrowsClicked ( ev: KeyboardEvent ) {
// if ( !ev.metaKey ) return;
let key = ev.which || ev.keyCode;
if ( key === 38 ) {
/** Up Arrow Key */
- 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 Generate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function Generate ( style: Style,
languageCharacter: string,
tabSize: number,
insertSpaces: boolean,
text?: string,
Function DragModeFunctionMoveMode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function DragModeFunctionMoveMode( circle: ISnapObject, dx: number,
dy: number, posx: number, posy: number ) {
Function DragModeFunctionEditMode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function DragModeFunctionEditMode( circle: ISnapObject, dx: number,
dy: number, posx: number, posy: number ) {
Function DragModeFunctionSelectMode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function DragModeFunctionSelectMode( circle: ISnapObject, dx: number,
dy: number, posx: number, posy: number ) {
Function DragModeFunctionRemoveMode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function DragModeFunctionRemoveMode( circle: ISnapObject, dx: number,
dy: number, posx: number, posy: number ) {
Function GenerateSayHTML
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function GenerateSayHTML ( input: any ): string {
// if were going to have an undefined type.
if ( input == undefined ) {
return SayImplementations.SayUndefined( );
- 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 size
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function size ( dots?: Array<KaryGraph.API.AbstractionLayer.DotObjectOrDotID> ): number {
var size: number = 0;
if ( dots === undefined ) {
for ( var i = 0; i < KaryGraph.Dot.TotalDots; i++ ) {
size += getdot(i + 1).NumberOfInputs();
- 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"