Showing 143 of 340 total issues
Function init
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function init() {
const canvas = createHiDPICanvas(650, 650, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
stage.x = 10;
Function measure
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
measure(): boolean {
this.measured = true;
//Extract orgin sizing from this.original to preserve
//metrics. autoMeasure will change style properties
//directly. Change this.original to rerender.
- 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
File Text.ts
has 415 lines of code (exceeds 250 allowed). Consider refactoring. Open
import TextContainer from "./TextContainer";
import Align from "./Align";
import FontLoader from "./FontLoader";
import Word from "./Word";
import Line from "./Line";
Function measure
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
measure(): boolean {
this.measured = true;
//Extract origin sizing from this.original to preserve
//metrics. autoMeasure will change style properties
//directly. Change this.original to re-render.
- 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
File Path.ts
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
export enum PathFit {
Rainbow,
Stairstep
}
Function wordLayout
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
wordLayout() {
// loop over words
// place into lines
const len = this.words.length;
let currentLine = new Line();
Function loadFont
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
static loadFont(fontName: string, loader: any) {
//determine if font exists in memory
if (FontLoader.fonts.hasOwnProperty(fontName)) {
//loading complete
if (FontLoader.fonts[fontName].loaded === true) {
Function init
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function init() {
const canvas = createHiDPICanvas(380, 400, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
stage.scaleX = stage.scaleY = 2;
Function init
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function init() {
const canvas = createHiDPICanvas(400, 500, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
Function init
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function init() {
const canvas = createHiDPICanvas(400, 600, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
Function measure
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
measure(): boolean {
this.measured = true;
//Extract orgin sizing from this.original to preserve
//metrics. autoMeasure will change style properties
//directly. Change this.original to rerender.
Function measure
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
measure(): boolean {
this.measured = true;
//Extract origin sizing from this.original to preserve
//metrics. autoMeasure will change style properties
//directly. Change this.original to re-render.
Function init
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function init() {
const canvas = createHiDPICanvas(450, 500, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
Function characterLayout
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
characterLayout(): boolean {
//characterlayout adds Charcters to words and measures true height. LineHeight is not a factor til Line layout.
//char layout
const len = this.text.length;
Function update
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
update() {
this.pathElement = document.createElementNS(
"http://www.w3.org/2000/svg",
"path"
) as SVGPathElement;
Function onload
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
req.onload = function() {
//localstorage set
if (localStorage && FontLoader.cache && this.cacheFont == undefined) {
localStorage.setItem(
"txt_font_" + fontName.split(" ").join("_"),
Function constructor
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(character: string, style: {}, index: number = null) {
super();
this.set(style);
this.index = index;
Function lineLayout
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
lineLayout() {
// loop over lines
// place into text
let measuredHeight = 0;
let line;
- 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 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function init() {
const canvas = createHiDPICanvas(1100, 700, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
stage.scaleX = stage.scaleY = 1;
Function init
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function init() {
const canvas = createHiDPICanvas(1100, 700, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
stage.scaleX = stage.scaleY = 1;