src/short-urls/helpers/index.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 9
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
mnd 1
bc 1
fnc 1
dl 0
loc 9
bpm 1
cpm 2
noi 0
c 0
b 0
f 0
rs 10
ccs 4
cts 4
cp 1
1
import { isNil } from 'ramda';
2
3 20
export const shortUrlMatches = (shortUrl, shortCode, domain) => {
4 14
  if (isNil(domain)) {
5 11
    return shortUrl.shortCode === shortCode && !shortUrl.domain;
6
  }
7
8 3
  return shortUrl.shortCode === shortCode && shortUrl.domain === domain;
9
};
10