Showing 367 of 1,006 total issues
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]) {
- 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 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
- 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 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);
- 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 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;
- 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 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 {
- 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 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]) {
- 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 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) {
- 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"