Strider-CD/strider

View on GitHub

Showing 1,006 of 1,006 total issues

Function forUser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

ProjectSchema.statics.forUser = function (user, done) {
  // Default to all projects
  let query = {};

  // If we are not an admin i.e account level is not set or < 1, show only user projects
Severity: Minor
Found in apps/strider/lib/models/project.js - About 25 mins 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 setupRegisterPanel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function setupRegisterPanel(common) {
  return function registerPanel(key, value) {
    // Nothing yet registered for this panel
    key = value.id;
    debug('!! registerPanel', key);
Severity: Minor
Found in apps/strider/lib/utils/register-panel.js - About 25 mins 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 projectProvider has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function projectProvider(req, res, next) {
    const project = req.project;
    req.providerConfig = function (config, next) {
        if (arguments.length === 0) {
            return project.provider.config;
Severity: Minor
Found in apps/strider/dist-lib/middleware.js - About 25 mins 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 createSession has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  .post(function createSession(req, res) {
    User.authenticate(req.body.email, req.body.password, function (err, user) {
      if (!user) {
        res.status(404).send({ message: 'No such username / password' });
      } else {
Severity: Minor
Found in apps/strider/lib/routes/api/session.js - About 25 mins 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 groupRepos has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function groupRepos(account, repomap, tree, repos) {
  const groups = deepObj(repomap, account.provider, account.id);
  const projectmap = getDeep(tree, account.provider, account.id) || {};
  for (let i = 0; i < repos.length; i++) {
    if (!groups[repos[i].group]) {
Severity: Minor
Found in apps/strider/lib/routes/projects.js - About 25 mins 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 projectProvider has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function projectProvider(req, res, next) {
  const project = req.project;

  req.providerConfig = function (config, next) {
    if (arguments.length === 0) {
Severity: Minor
Found in apps/strider/lib/middleware.js - About 25 mins 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

Severity
Category
Status
Source
Language