Showing 21 of 45 total issues
File index.ts
has 867 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Iniquity Core
* @module Core
* @summary This is the Iniquity core bbs library. It's the foundation of any Iniquity application.
* @example
Function Promise
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const Promise = function (
this: any,
executor: {
(resolve: any, reject: any): void
(resolve: any, reject: any): void
- 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 color
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
String.prototype.color = function (color: string): string {
switch (color) {
// 16 colors...
case "black":
return "\u001b[30m" + this
Function render
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
render(options?: IQArtworkRenderOptions): IQArtworkRenderFunctions {
if (options?.clearScreenBefore === true) console.putmsg("@POFF@@CLS@@PON@".color("reset"))
const basepath = options?.basepath ?? this.basepath
const filename = options?.filename ?? this.filename ?? new Error("I need to know what file to display!")
- 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 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(options?: IQArtworkRenderOptions): IQArtworkRenderFunctions {
if (options?.clearScreenBefore === true) console.putmsg("@POFF@@CLS@@PON@".color("reset"))
const basepath = options?.basepath ?? this.basepath
const filename = options?.filename ?? this.filename ?? new Error("I need to know what file to display!")
Function start
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
@IQModuleRuntime({
debug: true
})
start() {
/** Observe changes to "message" and react */
Function handler
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public handler(argv: yargs.Arguments) {
if (argv.install || argv.watch) {
if (fs.existsSync(".iniquity")) {
process.chdir(".iniquity")
Function handler
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public handler(argv: yargs.Arguments) {
if (argv.install || argv.watch) {
if (fs.existsSync(".iniquity")) {
process.chdir(".iniquity")
Function start
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
@IQ.Decorators.ModuleRuntime({ debug: true })
start() {
this.data.observe("message", () => {
const box = { width: 40, height: 5 }
Function Promise
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Promise = function (
this: any,
executor: {
(resolve: any, reject: any): void
(resolve: any, reject: any): void
Function welcome
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public welcome() {
"You just connected to an iniquity bbs. The artwork you are seeing above is called. It's still pretty new. Likely has bugs. Real talk, it's not even finished. But maybe you'll still think it's cool."
.newlines(2)
.color("background red")
Function prompt
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public prompt(options?: IQMenuPromptOptions | string): IQMenuPromptFunctions {
if (!this.commands) throw new Error("No commands appear to be configured for this menu.")
const commands = Object.keys(this.commands)
.filter((cmdkey) => cmdkey != "default")
- 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 IQReactor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function IQReactor(dataObj: any): IQReactorOptions {
const signals = {}
observeData(dataObj)
Function handler
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public handler(argv: yargs.Arguments) {
if (argv.install || argv.watch) {
if (fs.existsSync(".iniquity")) {
process.chdir(".iniquity")
- 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 handler
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public handler(argv: yargs.Arguments) {
if (argv.install || argv.watch) {
if (fs.existsSync(".iniquity")) {
process.chdir(".iniquity")
- 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 IQReactor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function IQReactor(dataObj: any): IQReactorOptions {
const signals = {}
observeData(dataObj)
- 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 handler
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public handler(argv: yargs.Arguments) {
if (!argv.help || !argv.version) {
if (argv.template === "eternity") {
copyfiles([path.join(__dirname, "../../../../templates/src/eternity/*"), "."], { up: true, all: true }, (err) => {})
copyfiles([path.join(__dirname, "../../../../templates/src/eternity/.iniquity/*"), ".iniquity"], { up: true, all: true }, (err) => {})
Function start
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public start() {
if (this.terminfo.x < 132 || this.terminfo.y < 37) {
this.say("Your terminal is too small to call this bbs. Please set your terminal scale to 132x37. It's way cooler.").wait(3000)
this.disconnect()
}
Function render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public render(module: Function, options?: IQMenuLoopOptions): void {
let count = 0
let cache: IQMenuLoopMessageResponse = {}
const maxInterval = options?.maxInterval ?? 10000000
- 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 handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public handler(argv: yargs.Arguments) {
if (!argv.help || !argv.version) {
if (argv.template === "eternity") {
copyfiles([path.join(__dirname, "../../../../templates/src/eternity/*"), "."], { up: true, all: true }, (err) => {})
copyfiles([path.join(__dirname, "../../../../templates/src/eternity/.iniquity/*"), ".iniquity"], { up: true, all: true }, (err) => {})
- 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"