src/Migration/RouterData.ts   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 24
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 24
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2
mnd 1
bc 1
fnc 1
bpm 1
cpm 2
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A RouterData.migrateRouterInternalToV102 0 10 2
1
import {PageData} from '@enbock/application-router/Router';
2
import {Observer} from '@enbock/state-value-observer/ValueObserver';
3
import {ModulePageData} from '../Application/Application';
4
5
export default class RouterData {
6
  private routerData: Observer<ModulePageData | null>;
7
8
  constructor(routerData: Observer<PageData | null>) {
9 3
    this.routerData = routerData as Observer<ModulePageData | null>;
10
  }
11
12
  migrateRouterInternalToV102(): void {
13 3
    const pageData: PageData | null | any = this.routerData.value;
14 4
    if (pageData == null || pageData.rootUrl == undefined) return;
15
16 1
    this.routerData.value = {
17
      baseUrl: pageData.rootUrl,
18
      currentUrl: pageData.url,
19
      name: pageData.name,
20
      module: pageData.module
21
    };
22
  }
23
}
24