pb10001/utakata-umigame

View on GitHub

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) {
Severity: Major
Found in socket.js - About 1 day to fix

    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) {
    Severity: Major
    Found in socket-legacy.js - About 1 day to fix

      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');
      Severity: Minor
      Found in socket.js - About 5 hrs to fix

        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 = {};
        Severity: Minor
        Found in socket-legacy.js - About 4 hrs to fix

          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();
          Severity: Major
          Found in client-beta/src/app/mondai/mondai.component.ts - About 2 hrs to fix

            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) {
            Severity: Minor
            Found in socket.js - About 2 hrs to fix

            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) {
            Severity: Minor
            Found in socket-legacy.js - About 2 hrs to fix

            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) {
            Severity: Minor
            Found in client/index.js - About 1 hr to fix

              Function send has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                send() {
                  if (this.subject === '問題文') {
                    if (window.confirm('問題文が変更されます。続行しますか?')) {
                      let data = {
                        type: 'mondai',
              Severity: Minor
              Found in client-beta/src/app/editor/editor.component.ts - About 1 hr to fix

                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',
                Severity: Minor
                Found in client-beta/src/app/editor/editor.component.ts - About 1 hr to fix

                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: [
                Severity: Minor
                Found in client-beta/src/karma.conf.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                    if (
                      nativeAddAll &&
                      (!userAgent ||
                        (agent === 'Firefox' && version >= 46) ||
                        (agent === 'Chrome' && version >= 50))
                  Severity: Major
                  Found in client/index.js - About 40 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language