src/scanner/static/js/bootbox.js
Function init
has 541 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
}(this, function init($, undefined) {
"use strict";
// the base DOM structure needed to create a modal
Function init
has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring. Open
Open
}(this, function init($, undefined) {
"use strict";
// the base DOM structure needed to create a modal
- 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
File bootbox.js
has 553 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* bootbox.js [master branch]
*
* http://bootboxjs.com/license.txt
*/
Function prompt
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.prompt = function() {
var options;
var defaults;
var dialog;
var form;
Function dialog
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.dialog = function(options) {
options = sanitize(options);
var dialog = $(templates.dialog);
var innerDialog = dialog.find(".modal-dialog");
Function sanitize
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sanitize(options) {
var buttons;
var total;
if (typeof options !== "object") {