SST-CTF/typing-test

View on GitHub

Showing 494 of 494 total issues

Function stopCP has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

(function stopCP () {
var onload = window.onload;
 
window.onload = function () {
if (typeof onload == "function") {
Severity: Minor
Found in js/main.js - About 5 hrs to fix

Function 'endTest' has too many statements (45). Maximum allowed is 30.
Open

function endTest() {
Severity: Minor
Found in js/main.js by eslint

Function 'calcStat' has too many statements (34). Maximum allowed is 30.
Open

function calcStat() {
Severity: Minor
Found in js/main.js by eslint

Function has a complexity of 9.
Open

window.onload = function () {
Severity: Minor
Found in js/main.js by eslint

Function endTest has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function endTest() {
//Clear the timer that tracks the progress of the test, since it's complete
clearTimeout(checkStatusInt);
 
//Initialize an object with the current date/time so we can calculate the difference
Severity: Minor
Found in js/main.js - About 2 hrs to fix

    Function 'calcStat' has a complexity of 8.
    Open

    function calcStat() {
    Severity: Minor
    Found in js/main.js by eslint

    Function calcStat has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function calcStat() {
    //If something goes wrong, we don't want to cancel the test -- so fallback error proection (in a way, just standard error handling)
    try {
    //Reset the timer to fire the statistical update function again in 250ms
    //We do this here so that if the test has ended (below) we can cancel and stop it
    Severity: Minor
    Found in js/main.js - About 1 hr to fix

      Function stopCP has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      (function stopCP () {
      var onload = window.onload;
       
      window.onload = function () {
      if (typeof onload == "function") {
      Severity: Minor
      Found in js/main.js - About 1 hr to fix

        Function onload has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        window.onload = function () {
        if (typeof onload == "function") {
        onload.apply(this, arguments);
        }
         
         
        Severity: Minor
        Found in js/main.js - About 1 hr to fix

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

          if (Number(3600 - totalTime) < 5) {
          tTT.innerHTML = "<font color=\"Red\">" + String(totalTime.toFixed(2)) + " sec. / " + String(Number(3600 - totalTime).toFixed(2)) + " sec.</font>";
          } else {
          if (Number(3600 - totalTime) < 15) {
          tTT.innerHTML = "<font color=\"Orange\">" + String(totalTime.toFixed(2)) + " sec. / " + String(Number(3600 - totalTime).toFixed(2)) + " sec.</font>";
          Severity: Major
          Found in js/main.js and 1 other location - About 1 hr to fix
          js/main.js on lines 324..328

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

          if (Number(3600 - totalTime) < 15) {
          tTT.innerHTML = "<font color=\"Orange\">" + String(totalTime.toFixed(2)) + " sec. / " + String(Number(3600 - totalTime).toFixed(2)) + " sec.</font>";
          } else {
          tTT.innerHTML = String(totalTime.toFixed(2)) + " sec. / " + String(Number(3600 - totalTime).toFixed(2)) + " sec.";
          }
          Severity: Major
          Found in js/main.js and 1 other location - About 1 hr to fix
          js/main.js on lines 321..329

          Consider simplifying this complex logical expression.
          Open

          if (
          person.search("ota") === - 1 &&
          person.search("Ota") === - 1 &&
          person.search("fruhwirth") === - 1 &&
          person.search("Fruhwirth") === - 1 &&
          Severity: Critical
          Found in js/main.js - About 1 hr to fix

            Function calcStat has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function calcStat() {
            //If something goes wrong, we don't want to cancel the test -- so fallback error proection (in a way, just standard error handling)
            try {
            //Reset the timer to fire the statistical update function again in 250ms
            //We do this here so that if the test has ended (below) we can cancel and stop it
            Severity: Minor
            Found in js/main.js - About 1 hr to fix

            Function myFunction has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function myFunction()
            {
            var person = prompt("Please enter your name", "");
            // Profanity Filter (if there is a better way to do this LMK)
            if (
            Severity: Minor
            Found in js/main.js - About 1 hr to fix

              Function endTest has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function endTest() {
              //Clear the timer that tracks the progress of the test, since it's complete
              clearTimeout(checkStatusInt);
               
              //Initialize an object with the current date/time so we can calculate the difference
              Severity: Minor
              Found in js/main.js - About 45 mins to fix

              Function readTextFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              function readTextFile(file, arrayData)
              {
              var rawFile = new XMLHttpRequest();
              rawFile.open("GET", file, false);
              rawFile.onreadystatechange = function ()
              Severity: Minor
              Found in js/main.js - About 25 mins to fix

              The universal selector (*) is known to be slow.
              Open

              *,*:before,*:after{
              Severity: Minor
              Found in css/stylesheet.css by csslint

              Adjoining classes: .sst-ul.sst-hoverable li:hover
              Open

              .sst-hoverable tbody tr:hover,.sst-ul.sst-hoverable li:hover{
              Severity: Minor
              Found in css/stylesheet.css by csslint

              Adjoining classes: .sst-btn-block.sst-disabled:hover
              Open

              .sst-btn.sst-disabled:hover,.sst-btn-block.sst-disabled:hover,.sst-btn:disabled:hover,.sst-btn-floating.sst-disabled:hover,.sst-btn-floating:disabled:hover, .sst-btn-floating-large.sst-disabled:hover,.sst-btn-floating-large:disabled:hover{
              Severity: Minor
              Found in css/stylesheet.css by csslint

              Adjoining classes: .sst-btn-block.sst-disabled:hover
              Open

              .sst-btn.sst-disabled:hover,.sst-btn-block.sst-disabled:hover,.sst-btn:disabled:hover,.sst-btn-floating.sst-disabled:hover,.sst-btn-floating:disabled:hover, .sst-btn-floating-large.sst-disabled:hover,.sst-btn-floating-large:disabled:hover{
              Severity: Minor
              Found in css/stylesheet.css by csslint
              Severity
              Category
              Status
              Source
              Language