Lavine.d.ts   B
last analyzed

Complexity

Total Complexity 43
Complexity/F 1

Size

Lines of Code 57
Function Count 43

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 41
dl 0
loc 57
rs 8.96
c 0
b 0
f 0
wmc 43
mnd 0
bc 0
fnc 43
bpm 0
cpm 1
noi 0

35 Functions

Rating   Name   Duplication   Size   Complexity  
A Render.addStyle 0 1 1
A Render.createHtml 0 1 1
A Render.changeContent 0 1 1
A Render.newElement 0 8 1
A Render.clearPage 0 1 1
A Render.removeElement 0 1 1
A Render.registerDinamicPage 0 1 1
A Render.setAtribute 0 1 1
A Reactive.createCycle 0 1 1
A Routes.getUpdateRoutes 0 1 1
A Routes.getRouteVars 0 1 1
A Routes.whenUpdate 0 1 1
A Routes.runRoute 0 1 1
A Reactive.findValue 0 1 1
A Reactive.syncEffect 0 1 1
A Routes.resolveAwait 0 1 1
A Routes.redirectLocation 0 1 1
A Routes.registerRoute 0 1 1
A Routes.whenChangeLocation 0 1 1
A Reactive.addReactiveElement 0 1 1
A Routes.whenChange 0 1 1
A Routes.getRoutesOutside 0 1 1
A Routes.removeVarsOfRoute 0 1 1
A Routes.whenChangeRoute 0 1 1
A Routes.whenAwait 0 1 1
A Routes.addEventSync 0 1 1
A Routes.goToLink 0 1 1
A ComponentsEngine.renderComponent 0 1 1
A ComponentsEngine.addListener 0 1 1
A Routes.routeExecution 0 1 1
A ComponentsEngine.createComponent 0 1 1
A Routes.registerNest 0 1 1
A Security.verifyRule 0 1 1
A Security.redirectRouteSecurity 0 1 1
A Security.AddSecurityRule 0 1 1

How to fix   Complexity   

Complexity

Complex classes like Lavine.d.ts often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

1
//Write this document for import for all functions of Lavine.js//
2
3
//render Lavine module
4
export class Render{
5
    /**
6
     * Create one new Element for your page,insert one Id.
7
     * @param {string} renderElement name of tag Html what your want add to page.
8
     * @param {string} content Content for your new element.
9
     * @param {string} selectObject Target object of your add the new element.
10
     * @param {string} Id Id target for ypur new element.
11
     */
12
    newElement(renderElement:any,content:any,selectObject:any,classList:any,Id:any):void
13
    createHtml(elementTarget:any,content:any):void
14
    changeContent(id:any,content:any):void
15
    removeElement(element:any):void
16
    setAtribute(elementId:any,atribute:any,value:any):void
17
    addStyle(elementId:any,ruleCss:any):void
18
    registerDinamicPage(pageId:any):void
19
    clearPage():void
20
}
21
22
export class ComponentsEngine{
23
    createComponent(componentName:any,content:any):void
24
    renderComponent(targetRender:any,componentName:any):void
25
    addListener(targetElement:any,type:any,functionCall:any):void
26
}
27
28
export class Reactive{
29
    addReactiveElement(element:any,effect:any):void
30
    findValue(valueElement:any):void
31
    syncEffect():void
32
    createCycle():void
33
}
34
export class Routes{
35
    goToLink(link:any):void
36
    getUpdateRoutes():void
37
    getRouteVars():void
38
    getRoutesOutside(routetarget:any):void
39
    removeVarsOfRoute(route:any):any
40
    registerRoute(routePathRegister:any, compEvent:any):void
41
    runRoute(initialPage:any, InitialPageRedirect:any):void
42
    whenUpdate(eventClass:any):void
43
    whenChange(eventClass:any, object:any):void
44
    whenChangeRoute(eventClass:any):void
45
    whenChangeLocation(eventClass:any):void
46
    redirectLocation():void
47
    addEventSync():void
48
    resolveAwait():void
49
    whenAwait(eventClass:any):void
50
    routeExecution(initialpage:any,initialPageRedirect:any):void
51
    registerNest(linkedTo:any,routePathRegister:any,compevent:any,nest:any):void
52
}
53
export class Security{
54
    AddSecurityRule(rulefunction:any,NameRule:any):void
55
    verifyRule(DataVerify:any):void
56
    redirectRouteSecurity(route:any):void
57
}