iniquitybbs/iniquity

View on GitHub

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
Severity: Major
Found in packages/core/src/index.ts - About 2 days to fix

    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
    Severity: Minor
    Found in packages/core/src/pollyfills.ts - About 2 hrs to fix

    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
    Severity: Major
    Found in packages/core/src/index.ts - About 2 hrs to fix

      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!")
      Severity: Minor
      Found in packages/core/src/index.ts - About 2 hrs to fix

      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!")
      Severity: Major
      Found in packages/core/src/index.ts - About 2 hrs to fix

        Function start has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @IQModuleRuntime({
                debug: true
            })
            start() {
                /** Observe changes to "message" and react */
        Severity: Major
        Found in packages/core/src/modules/answer.ts - About 2 hrs to fix

          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")
          
          
          Severity: Major
          Found in packages/iniquity/src/commands/update.ts - About 2 hrs to fix

            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")
            
            
            Severity: Major
            Found in packages/iniquity/src/commands/server.ts - About 2 hrs to fix

              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 }
              
              
              Severity: Major
              Found in packages/core/src/modules/wfc.ts - About 2 hrs to fix

                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
                Severity: Major
                Found in packages/core/src/pollyfills.ts - About 2 hrs to fix

                  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")
                  
                  
                  Severity: Minor
                  Found in packages/templates/src/eternity/iniquity.ts - About 1 hr to fix

                    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")
                    Severity: Minor
                    Found in packages/core/src/index.ts - About 1 hr to fix

                    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)
                    
                    
                    Severity: Minor
                    Found in packages/core/src/index.ts - About 1 hr to fix

                      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")
                      
                      
                      Severity: Minor
                      Found in packages/iniquity/src/commands/update.ts - About 1 hr to fix

                      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")
                      
                      
                      Severity: Minor
                      Found in packages/iniquity/src/commands/server.ts - About 1 hr to fix

                      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)
                      
                      
                      Severity: Minor
                      Found in packages/core/src/index.ts - About 1 hr to fix

                      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) => {})
                      Severity: Minor
                      Found in packages/iniquity/src/commands/init.ts - About 1 hr to fix

                        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()
                                }
                        Severity: Minor
                        Found in packages/templates/src/eternity/iniquity.ts - About 1 hr to fix

                          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
                          
                          
                          Severity: Minor
                          Found in packages/core/src/index.ts - About 55 mins to fix

                          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) => {})
                          Severity: Minor
                          Found in packages/iniquity/src/commands/init.ts - About 25 mins to fix

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language