Passed
Pull Request — master (#421)
by
unknown
02:36
created

src/Infrastructure/FairCalendar/Routing/urls.ts   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 13
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A urls.ts ➔ makeMonthUrl 0 10 1
1
import { RouteNameResolver } from "src/Infrastructure/Common/ExtendedRouting/RouteNameResolver";
2
3
export function makeMonthUrl(resolver: RouteNameResolver, date: Date): string {
4
  const url = resolver.resolve('faircalendar_index');
5
6
  const params = new URLSearchParams({
7
    month: (date.getMonth() + 1).toString(),
8
    year: (date.getFullYear()).toString(),
9
  });
10
11
  return url + '?' + params.toString();
12
}
13