GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 0b5ede...a545f1 )
by Vladimir
29s
created

src/routes/index.js   A

Complexity

Total Complexity 4
Complexity/F 1.33

Size

Lines of Code 34
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
nc 4
dl 0
loc 34
rs 10
c 2
b 0
f 0
wmc 4
mnd 1
bc 4
fnc 3
bpm 1.3333
cpm 1.3333
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A index.js ➔ ??? 0 4 1
1
const express = require('express');
2
3
const router = express.Router();
4
5
router.get('/', (req, res) => {
6
  const streamId = Math.random().toString(36).substring(2);
7
  res.redirect(`/${streamId}`);
8
});
9
10
router.get('/:streamId?', (req, res) => {
11
  res.render('index', {
12
    hostName: global.APP_HOST_NAME,
13
    host: global.APP_HOST,
14
    port: global.APP_PORT_FOR_HELP_BLOCK,
15
    socketIoJs: global.APP_SOCKET_IO_JS,
16
    streamId: req.params.streamId,
17
  });
18
});
19
20
router.post('/:streamId?', (req, res) => {
21
  const ip = req.headers['x-forwarded-for']
22
    || req.connection.remoteAddress
23
    || req.socket.remoteAddress
24
    || req.connection.socket.remoteAddress;
25
26
  if (req.headers['content-type'] === 'application/json') {
27
    global.socket.emit('log', {
28
      streamId: req.params.streamId, format: 'json', data: req.body, ip,
29
    });
30
  }
31
  res.send('');
32
});
33
34
module.exports = router;
35