string.bullet.js   A
last analyzed

Complexity

Total Complexity 5
Complexity/F 2.5

Size

Lines of Code 13
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
cc 0
wmc 5
c 4
b 0
f 0
nc 8
mnd 1
bc 1
fnc 2
dl 0
loc 13
rs 10
bpm 0.5
cpm 2.5
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A ➔ ??? 0 9 3
1
"use strict";
2
3
const { blank } = require ('printable-characters')
4
5
module.exports = (bullet, arg) => {
6
7
                    const isArray = Array.isArray (arg),
8
                          lines   = isArray ? arg : arg.split ('\n'),
9
                          indent  = blank (bullet),
10
                          result  = lines.map ((line, i) => (i === 0) ? (bullet + line) : (indent + line))
11
                    
12
                    return isArray ? result : result.join ('\n')
13
                }