examples/lib/defaultHtmlStepUi.js
Function DefaultHtmlStepUi
has a Cognitive Complexity of 116 (exceeds 5 allowed). Consider refactoring. Open
Open
function DefaultHtmlStepUi(_sequencer, options) {
options = options || {};
var stepsEl = options.stepsEl || document.querySelector('#steps');
var selectStepSel = options.selectStepSel = options.selectStepSel || '#selectStep';
- Read upRead up
- Create a ticketCreate a ticket
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 DefaultHtmlStepUi
has 382 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DefaultHtmlStepUi(_sequencer, options) {
options = options || {};
var stepsEl = options.stepsEl || document.querySelector('#steps');
var selectStepSel = options.selectStepSel = options.selectStepSel || '#selectStep';
- Create a ticketCreate a ticket
Function onSetup
has 243 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onSetup(step, stepOptions) {
if (step.options && step.options.description)
step.description = step.options.description;
let stepDocsLink = '';
- Create a ticketCreate a ticket
File defaultHtmlStepUi.js
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Set the UI in sequencer. This Will generate HTML based on
// Image Sequencer events :
// onSetup : Called every time a step is added
// onDraw : Called every time a step starts draw
// onComplete : Called every time a step finishes drawing
- Create a ticketCreate a ticket
Function onComplete
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onComplete(step) {
let {$step, $stepAll} = step;
$step('img').show();
$stepAll('.load-spin').hide();
$step('.load').hide();
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (inputDesc.type.toLowerCase() == 'range') {
html +=
'"min="' +
inputDesc.min +
'"max="' +
- Create a ticketCreate a ticket