Strider-CD/strider

View on GitHub

Showing 367 of 1,006 total issues

Function exports has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function ($scope) {
  setTimeout(function () {
    if (global.location.hash === '#manual') $('a[href="#manual-setup"]').tab('show');
  }, 200);
  $scope.accounts = global.accounts;
Severity: Major
Found in clients/classic-ui/client/projects/controllers/projects.js - About 3 hrs to fix

    Function job has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.job = function (req, res) {
      res.statusCode = 200;
      const org = req.params.org;
      const repo = req.params.repo;
      const jobId = req.params.job_id;
    Severity: Major
    Found in apps/strider/lib/routes/admin/index.js - About 3 hrs to fix

      Function runTest has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function runTest(email, password, project, branch, message, deploy) {
          if (!email || !password || !project) {
            const rl = readline.createInterface({
              input: process.stdin,
              output: process.stdout,
      Severity: Major
      Found in apps/strider/lib/cli/lib/run-test.js - About 3 hrs to fix

        Function cmd has 90 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          cmd: function (cmd, plugin, next) {
            if (arguments.length === 2) {
              next = plugin;
              plugin = null;
            }
        Severity: Major
        Found in modules/strider-runner-core/lib/job.js - About 3 hrs to fix

          Function runTest has 90 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function runTest(email, password, project, branch, message, deploy) {
                  if (!email || !password || !project) {
                      const rl = readline.createInterface({
                          input: process.stdin,
                          output: process.stdout,
          Severity: Major
          Found in apps/strider/dist-lib/cli/lib/run-test.js - About 3 hrs to fix

            Function html has 90 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function html(req, res, next) {
              if (req.params.org === 'auth') {
                return next();
              }
            
            
            Severity: Major
            Found in apps/strider/lib/routes/jobs/index.js - About 3 hrs to fix

              Function humaneDate has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

              exports.humaneDate = function humaneDate(date, compareTo) {
                  if (!date) {
                      return;
                  }
                  const lang = {
              Severity: Minor
              Found in apps/strider/dist-lib/utils/humane.js - About 3 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 humaneDate has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

              exports.humaneDate = function humaneDate(date, compareTo) {
                if (!date) {
                  return;
                }
              
              
              Severity: Minor
              Found in apps/strider/lib/utils/humane.js - About 3 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 html has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function html(req, res, next) {
                  if (req.params.org === 'auth') {
                      return next();
                  }
                  const id = req.params.id;
              Severity: Major
              Found in apps/strider/dist-lib/routes/jobs/index.js - About 3 hrs to fix

                File backchannel.js has 309 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*
                 * Backchannel server allows workers to stream messages back to the Node server
                 * in a line-buffered way. Uses SSL.
                 */
                
                
                Severity: Minor
                Found in apps/strider/lib/backchannel.js - About 3 hrs to fix

                  File index.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  const _ = require('lodash');
                  const common = require('../common');
                  const config = require('../config');
                  const debug = require('debug')('strider:routes');
                  const jobs = require('../jobs');
                  Severity: Minor
                  Found in apps/strider/lib/routes/index.js - About 3 hrs to fix

                    Function addJob has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                      addJob(job) {
                        if ((job.project.name || job.project) !== this.project) return;
                        this.jobs[job._id] = job;
                        var found = -1;
                    
                    
                    Severity: Minor
                    Found in clients/classic-ui/client/job-status/controllers/job.js - About 3 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

                    File auth.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    const crypto = require('crypto');
                    const BluebirdPromise = require('bluebird');
                    const passport = require('passport');
                    const LocalStrategy = require('passport-local').Strategy;
                    const utils = require('./utils');
                    Severity: Minor
                    Found in apps/strider/lib/auth.js - About 3 hrs to fix

                      Function job has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      exports.job = function (req, res) {
                          res.statusCode = 200;
                          const org = req.params.org;
                          const repo = req.params.repo;
                          const jobId = req.params.job_id;
                      Severity: Major
                      Found in apps/strider/dist-lib/routes/admin/index.js - About 3 hrs to fix

                        Function prepareJob has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function prepareJob(emitter, job) {
                          Project.findOne({ name: job.project })
                            .populate('creator')
                            .exec(function (err, project) {
                              if (err || !project)
                        Severity: Major
                        Found in apps/strider/lib/backchannel.js - About 3 hrs to fix

                          File user.js has 296 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          "use strict";
                          var __importDefault = (this && this.__importDefault) || function (mod) {
                              return (mod && mod.__esModule) ? mod : { "default": mod };
                          };
                          Object.defineProperty(exports, "__esModule", { value: true });
                          Severity: Minor
                          Found in apps/strider/dist-lib/models/user.js - About 3 hrs to fix

                            Function createProject has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                            exports.createProject = function (req, res, next) {
                                if (req.params.org === 'auth') {
                                    return next();
                                }
                                let name = `${req.params.org}/${req.params.repo}`;
                            Severity: Minor
                            Found in apps/strider/dist-lib/routes/api/repo.js - About 3 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 createProject has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                            exports.createProject = function (req, res, next) {
                              if (req.params.org === 'auth') {
                                return next();
                              }
                            
                            
                            Severity: Minor
                            Found in apps/strider/lib/routes/api/repo.js - About 3 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 authenticate has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            UserSchema.statics.authenticate = function (
                              email: string,
                              password: string,
                              callback: Function
                            ): void {
                            Severity: Major
                            Found in apps/strider/lib/models/user.ts - About 3 hrs to fix

                              Function exports has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              module.exports = function (deps) {
                                const saveUser = require('./save-user')(deps);
                              
                                function addUser(email, password, admin, force) {
                                  let level = admin ? 1 : 0;
                              Severity: Major
                              Found in apps/strider/lib/cli/lib/add-user.js - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language