Passed
Pull Request — master (#2)
by André
01:32
created

src/input.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 24
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 2
eloc 15
c 1
b 0
f 0
nc 1
mnd 0
bc 2
fnc 2
dl 0
loc 24
rs 10
bpm 1
cpm 1
noi 3

1 Function

Rating   Name   Duplication   Size   Complexity  
A input.js ➔ ??? 0 22 1
1
'use strict'
2
3
module.exports = (input, callback) => {
4
	const mqtt = require('mqtt')
0 ignored issues
show
Unused Code introduced by
The constant mqtt seems to be never used. Consider removing it.
Loading history...
5
	const validate = require('./validate')
6
	let error = null
7
	let output = null
0 ignored issues
show
Unused Code introduced by
The assignment to output seems to be never used. If you intend to free memory here, this is not necessary since the variable leaves the scope anyway.
Loading history...
8
9
	validate(input, (validatedInput, thrownError) => {
10
		input = validatedInput
11
		error = thrownError
12
	})
13
14
	output = {
15
		'version': {'ref': 'input'},
16
		'metadata': [
17
			{'name': 'topic', 'value': 'Hulk Hogan'},
18
			{'name': 'timestamp', 'value': Date.now().toString()}
19
		]
20
	}
21
22
23
	callback(error, output, source)
0 ignored issues
show
Bug introduced by
The variable source seems to be never declared. If this is a global, consider adding a /** global: source */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
24
}
25