JSMD/workflow

View on GitHub

Showing 4 of 4 total issues

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

dispatchEnter(subject, transition, marking) {
const places = transition.tos;
const workflowEvent = new event.Event(subject, marking, transition, this.name);
 
this.emit('workflow.enter', workflowEvent);
Severity: Major
Found in src/helper/event-dispatcher.js and 1 other location - About 5 hrs to fix
src/helper/event-dispatcher.js on lines 4..16

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

dispatchLeave(subject, transition, marking) {
const places = transition.froms;
const workflowEvent = new event.Event(subject, marking, transition, this.name);
 
this.emit('workflow.leave', workflowEvent);
Severity: Major
Found in src/helper/event-dispatcher.js and 1 other location - About 5 hrs to fix
src/helper/event-dispatcher.js on lines 26..38

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

if (transition instanceof Transition) {
transition.froms.forEach(validatePlaces.bind(this)('from'));
transition.tos.forEach(validatePlaces.bind(this)('to'));
 
this.transitions.add(transition);
Severity: Major
Found in src/module/definition-builder.js and 1 other location - About 2 hrs to fix
src/module/definition.js on lines 45..52

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

if (transition instanceof Transition) {
transition.froms.forEach(validatePlaces.bind(this)('from'));
transition.tos.forEach(validatePlaces.bind(this)('to'));
 
this.transitions.add(transition);
Severity: Major
Found in src/module/definition.js and 1 other location - About 2 hrs to fix
src/module/definition-builder.js on lines 56..63
Severity
Category
Status
Source
Language