BAN-AI-Multics/sshwifty

View on GitHub

Showing 284 of 284 total issues

File ssh.js has 772 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Sshwifty - A Web SSH client
//
// Copyright (C) 2019-2021 NI Rui <ranqus@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
Severity: Major
Found in ui/commands/ssh.js - About 1 day to fix

    Function startApp has 305 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function startApp(rootEl) {
      const pageTitle = document.title;
    
      const uiControlColor = new ControlColor();
    
    
    Severity: Major
    Found in ui/app.js - About 1 day to fix

      File screen_console_keys.js has 582 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Sshwifty - A Web SSH client
      //
      // Copyright (C) 2019-2021 NI Rui <ranqus@gmail.com>
      //
      // This program is free software: you can redistribute it and/or modify
      Severity: Major
      Found in ui/widgets/screen_console_keys.js - About 1 day to fix

        Function startApp has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
        Open

        function startApp(rootEl) {
          const pageTitle = document.title;
        
          const uiControlColor = new ControlColor();
        
        
        Severity: Minor
        Found in ui/app.js - About 1 day 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

        File telnet.js has 469 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // Sshwifty - A Web SSH client
        //
        // Copyright (C) 2019-2021 NI Rui <ranqus@gmail.com>
        //
        // This program is free software: you can redistribute it and/or modify
        Severity: Minor
        Found in ui/commands/telnet.js - About 7 hrs to fix

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

              const waiter = new Promise((resolve) => {
                let closed = false;
          
                proc.stdout.on("data", (msg) => {
                  process.stdout.write(msg.toString());
          Severity: Major
          Found in webpack.config.js and 1 other location - About 7 hrs to fix
          webpack.config.js on lines 128..153

          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 180.

          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 waiter = new Promise((resolve) => {
                let closed = false;
          
                proc.stdout.on("data", (msg) => {
                  process.stdout.write(msg.toString());
          Severity: Major
          Found in webpack.config.js and 1 other location - About 7 hrs to fix
          webpack.config.js on lines 78..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 180.

          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

              if (this.charset === "utf-8") {
                const enc = new TextEncoder();
          
                this.charsetDecoder = (d) => {
                  return d;
          Severity: Major
          Found in ui/control/ssh.js and 1 other location - About 7 hrs to fix
          ui/control/telnet.js on lines 337..362

          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 178.

          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

              if (this.charset === "utf-8") {
                const enc = new TextEncoder();
          
                this.charsetDecoder = (d) => {
                  return d;
          Severity: Major
          Found in ui/control/telnet.js and 1 other location - About 7 hrs to fix
          ui/control/ssh.js on lines 31..56

          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 178.

          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 build has 165 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function build(tabIndex, i, field) {
            return {
              verified: false,
              modified: false,
              inputted: false,
          Severity: Major
          Found in ui/widgets/connector_field_builder.js - About 6 hrs to fix

            Function build has 158 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function build(ctx) {
              const connectionStatusNotConnected = "Ready to connect";
              const connectionStatusConnecting = "Connecting to server...";
              const connectionStatusDisconnected = "Disconnected from server";
              const connectionStatusConnected = "Connected to server";
            Severity: Major
            Found in ui/home_socketctl.js - About 6 hrs to fix

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

                  verify(d) {
                    if (d.length <= 0) {
                      throw new Error("Hostname must be specified");
                    }
              
              
              Severity: Major
              Found in ui/commands/telnet.js and 1 other location - About 5 hrs to fix
              ui/commands/ssh.js on lines 272..294

              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 152.

              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

                  verify(d) {
                    if (d.length <= 0) {
                      throw new Error("Hostname must be specified");
                    }
              
              
              Severity: Major
              Found in ui/commands/ssh.js and 1 other location - About 5 hrs to fix
              ui/commands/telnet.js on lines 195..217

              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 152.

              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

                  for (const i in tests) {
                    if (tests[i].expectingFailure) {
                      let ee = null;
              
                      try {
              Severity: Major
              Found in ui/commands/common_test.js and 1 other location - About 5 hrs to fix
              ui/commands/common_test.js on lines 56..72

              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 147.

              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

                  for (const i in tests) {
                    if (tests[i].expectingFailure) {
                      let ee = null;
              
                      try {
              Severity: Major
              Found in ui/commands/common_test.js and 1 other location - About 5 hrs to fix
              ui/commands/common_test.js on lines 149..165

              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 147.

              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 build has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
              Open

              export function build(tabIndex, i, field) {
                return {
                  verified: false,
                  modified: false,
                  inputted: false,
              Severity: Minor
              Found in ui/widgets/connector_field_builder.js - About 5 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

              File commands.js has 398 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // Sshwifty - A Web SSH client
              //
              // Copyright (C) 2019-2021 NI Rui <ranqus@gmail.com>
              //
              // This program is free software: you can redistribute it and/or modify
              Severity: Minor
              Found in ui/commands/commands.js - About 5 hrs to fix

                File telnet.js has 381 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // Sshwifty - A Web SSH client
                //
                // Copyright (C) 2019-2021 NI Rui <ranqus@gmail.com>
                //
                // This program is free software: you can redistribute it and/or modify
                Severity: Minor
                Found in ui/control/telnet.js - About 5 hrs to fix

                  File app.js has 368 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  // Sshwifty - A Web SSH client
                  //
                  // Copyright (C) 2021 Jeffrey H. Johnson <trnsz+banai@pobox.com>
                  // Copyright (C) 2019-2021 NI Rui <ranqus@gmail.com>
                  //
                  Severity: Minor
                  Found in ui/app.js - About 4 hrs to fix

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

                      Encoding: {
                        name: "Encoding",
                        description: "The character encoding of the server",
                        type: "select",
                        value: "utf-8",
                    Severity: Major
                    Found in ui/commands/ssh.js and 1 other location - About 4 hrs to fix
                    ui/commands/telnet.js on lines 219..240

                    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 125.

                    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