Showing 12 of 77 total issues
Function exports
has 363 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(socket) {
user_id += 1;
socket.user_id = user_id;
sockets.push(socket);
socket.on('join', function(roomName) {
Function exports
has 350 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(socket) {
user_id += 1;
socket.user_id = user_id;
sockets.push(socket);
socket.on('join', function(roomName) {
File socket.js
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var async = require('async');
var client = require('./redis_client');
var moment = require('moment');
File socket-legacy.js
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
var async = require('async');
var client = require('./redis_client');
var moment = require('moment');
var mondai = {};
var trueAns = {};
Function ngOnInit
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit () {
this.currentRoom = this.route.snapshot.paramMap.get('id');
// this.socketService.emit('join', this.currentRoom);
this.name = this.userService.getName();
this.removePass = this.userService.getRemovePass();
Function exports
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(socket) {
user_id += 1;
socket.user_id = user_id;
sockets.push(socket);
socket.on('join', function(roomName) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function exports
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(socket) {
user_id += 1;
socket.user_id = user_id;
sockets.push(socket);
socket.on('join', function(roomName) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function addAll
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Cache.prototype.addAll = function addAll(requests) {
var cache = this;
// Since DOMExceptions are not constructable:
function NetworkError(message) {
Function send
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
send() {
if (this.subject === '問題文') {
if (window.confirm('問題文が変更されます。続行しますか?')) {
let data = {
type: 'mondai',
Function send
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
send() {
if (this.subject === '問題文') {
if (window.confirm('問題文が変更されます。続行しますか?')) {
let data = {
type: 'mondai',
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
Consider simplifying this complex logical expression. Open
if (
nativeAddAll &&
(!userAgent ||
(agent === 'Firefox' && version >= 46) ||
(agent === 'Chrome' && version >= 50))