src/resources/assets/js/lib/nxt-ui.js
File nxt-ui.js
has 472 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*******************************************************************************
* Main Functions
*
*******************************************************************************/
Function nxt_motor
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function nxt_motor() {
motorHTML = `
<div id="left">
<div id="port">
<h3>Port</h3>
Function fileUpload
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
function fileUpload() {
var x = document.getElementById("myFile");
var txt = "";
if ('files' in x) {
if (x.files.length == 0) {
- 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 nxt_sound
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function nxt_sound() {
soundHTML = `
<div id="left">
<div id="action">
<h3>Action</h3>
Function __modal__
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function __modal__(header, htmlBody) {
var html = `
<div class="modal-content">
<div class="modal-header">
<span class="close">Χ</span>