frontend/src/components/Login.tsx   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 15
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 40%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 15
ccs 2
cts 5
cp 0.4
rs 10
c 0
b 0
f 0
wmc 1
mnd 0
bc 0
fnc 1
bpm 0
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A Login.tsx ➔ Login 0 10 1
1
import { Button, ButtonProps } from 'flowbite-react';
2
import { GITHUB_URL } from '../helpers/config';
3
4
export default function Login(props: ButtonProps) {
5
6 5
  const loginUser = (e: React.MouseEvent<HTMLButtonElement>) => {
7
      e.preventDefault();
8
      window.location.href = GITHUB_URL;
9
  };
10
11 5
  return (
12
    <Button {...props} data-testid="loginbutton" color="success" onClick={(e) => loginUser(e)}>Logga in</Button>
13
  )
14
}
15