Passed
Push — master ( f28044...8bf019 )
by Felipe Catão do
01:08
created

LavineWiki/components/articlefrag.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 18
Function Count 2

Duplication

Duplicated Lines 18
Ratio 100 %

Importance

Changes 0
Metric Value
wmc 2
eloc 12
mnd 0
bc 0
fnc 2
dl 18
loc 18
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A articlefrag.js ➔ articlefrag 4 4 1
A articlefrag.js ➔ articleRender 7 7 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1 View Code Duplication
import EngineApp from '../../Framework/engine.js'
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2
let eng =new EngineApp()
3
4
function articlefrag(id,title,content,target){
5
    eng.componentsEngine.createComponent("article"+id,articleRender(title,content))
6
    eng.componentsEngine.renderComponent(target,"article"+id)
7
}
8
9
function articleRender(title,content){
10
    return "<br><div class='articleFrag'>"+
11
    "<h1>"+title+"</h1>"+
12
    "<article>"+content+"</article>"+
13
    "<hr>"+
14
    "</div>"
15
}
16
17
18
export default articlefrag