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 ( 0b5084...8dca1a )
by Vladimir
29s
created

src/routes/index.js   A

Complexity

Total Complexity 4
Complexity/F 1.33

Size

Lines of Code 30
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

3 Functions

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