Showing 9 of 15 total issues
Function exports
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(RED) {
'use strict';
function mopidyOutNode(n) {
this.RED = RED;
- 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 exports
has 158 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(RED) {
'use strict';
function mopidyOutNode(n) {
this.RED = RED;
Function mopidyOutNode
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function mopidyOutNode(n) {
this.RED = RED;
this.servers = servers;
this.objectPath = objectPath;
Function invokeMethod
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.invokeMethod = (incomingMsg = {}) => {
if (typeof incomingMsg !== 'object') {
this.error(this.RED._('mopidy-out.validation.data-must-be-object'));
return;
}
Function exports
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(RED) {
'use strict';
function mopidyInNode(n) {
this.RED = RED;
Function mopidyInNode
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function mopidyInNode(n) {
this.RED = RED;
this.servers = servers;
this.objectPath = objectPath;
Function exports
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(RED) {
'use strict';
function mopidyInNode(n) {
this.RED = RED;
- 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 routeMethods
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.routeMethods = (req, res) => {
let tempServerNode = this.RED.nodes.getNode(req.params.nodeId);
if (tempServerNode === undefined || tempServerNode === null) {
res.status(404).json({
Avoid too many return
statements within this function. Open
Open
return;