iniquitybbs/iniquity

View on GitHub

Showing 45 of 45 total issues

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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    @IQModule({
        basepath: "/iniquity/core/src/assets",
        access: IQModuleACLS.low,
        assets: "",
        encoding: "CP437",
    Severity: Major
    Found in packages/core/src/modules/hangup.ts and 1 other location - About 2 hrs to fix
    packages/core/src/modules/answer.ts on lines 5..103

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 76.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    @IQModule({
        basepath: "/iniquity/core/src/assets",
        access: IQModuleACLS.low,
        assets: "",
        encoding: "CP437",
    Severity: Major
    Found in packages/core/src/modules/answer.ts and 1 other location - About 2 hrs to fix
    packages/core/src/modules/hangup.ts on lines 3..24

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 76.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      const composeOptions: compose.IDockerComposeOptions = {
          composeOptions: ["-f", path.join(".iniquity/docker-compose.yml") || process.env["COMPOSE_FILE"] || ""],
          log: true,
          env: process.env
      }
      Severity: Major
      Found in packages/iniquity/src/commands/update.ts and 1 other location - About 1 hr to fix
      packages/iniquity/src/commands/server.ts on lines 50..54

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 66.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      const composeOptions: compose.IDockerComposeOptions = {
          composeOptions: ["-f", path.join(".iniquity/docker-compose.yml") || process.env["COMPOSE_FILE"] || ""],
          log: true,
          env: process.env
      }
      Severity: Major
      Found in packages/iniquity/src/commands/server.ts and 1 other location - About 1 hr to fix
      packages/iniquity/src/commands/update.ts on lines 50..54

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 66.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          export function ask(question: string, callback?: any): string | undefined {
              if (!callback) return iq.ask(question)
              else callback(iq.ask(question))
          }
      Severity: Major
      Found in packages/core/src/index.ts and 1 other location - About 1 hr to fix
      packages/core/src/index.ts on lines 1209..1212

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 65.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      export function ask(question: string, callback?: any): string | undefined {
          if (!callback) return iq.ask(question)
          else callback(iq.ask(question))
      }
      Severity: Major
      Found in packages/core/src/index.ts and 1 other location - About 1 hr to fix
      packages/core/src/index.ts on lines 1265..1268

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 65.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      export interface IBBSSayFunctions {
          /**
           * @param {IQPauseOptions} options
           * {@link IQPauseOptions}
           */
      Severity: Major
      Found in packages/core/src/index.ts and 1 other location - About 1 hr to fix
      packages/core/src/index.ts on lines 283..291

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      export interface IBBSPrintFunctions {
          /**
           * @param {IQPauseOptions} options
           * @see {@link IQPauseOptions}
           */
      Severity: Major
      Found in packages/core/src/index.ts and 1 other location - About 1 hr to fix
      packages/core/src/index.ts on lines 274..282

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                            A: (metadata = { description: "About this." }) => {
                                this.data.model.message = "Preparing to apply to this bbs."
                                return {
                                    metadata
                                }
            Severity: Major
            Found in packages/core/src/modules/wfc.ts and 2 other locations - About 40 mins to fix
            packages/core/src/modules/wfc.ts on lines 55..60
            packages/core/src/modules/wfc.ts on lines 61..66

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 49.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                            O: (metadata = { description: "About this." }) => {
                                this.data.model.message = "You pressed O. Oh how cool."
                                return {
                                    metadata
                                }
            Severity: Major
            Found in packages/core/src/modules/wfc.ts and 2 other locations - About 40 mins to fix
            packages/core/src/modules/wfc.ts on lines 49..54
            packages/core/src/modules/wfc.ts on lines 61..66

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 49.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language