packages/nft-bitmap-react/src/controllers/Pixelizer.ts
Showing 3 of 3 total issues
File Pixelizer.ts
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/** * Pixelizer - convert an image to Pixel Art, with/out grayscale and based on a color palette. * @author José Moreira @ <https://github.com/giventofly/pixelit> * @author Michael Feher @ <https://github.com/PhearZero> **/
Function pixelate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
pixelate() { const tempCanvas = document.createElement("canvas"); if(!this.drawfrom) throw new Error(DRAWFROM_NOT_DEFINED_MESSAGE) if(!this.drawto) throw new Error(DRAWTO_NOT_DEFINED_MESSAGE)
- Read upRead up
Function resizeImage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
resizeImage() { if(!this.drawto) throw new Error(DRAWTO_NOT_DEFINED_MESSAGE) if(!this.ctx) throw new Error(CONTEXT_NOT_DEFINED_MESSAGE) //var ctx = canvas.getContext("2d")
- Read upRead up