oaeproject/Hilary

View on GitHub

Showing 625 of 882 total issues

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

const _produceContentSearchDocument = function (content, revision) {
  // Allow full-text search on name and description, but only if they are specified. We also sort on this text
  let fullText = compact([content.displayName, content.description]).join(' ');
  if (isResourceACollabDoc(content.resourceSubType) && revision && revision.etherpadHtml) {
    fullText += ' ' + revision.etherpadHtml;
Severity: Minor
Found in packages/oae-content/lib/search.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 storeMetadata has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const storeMetadata = function (
  contentObject,
  revisionId,
  status,
  thumbnailUri,
Severity: Minor
Found in packages/oae-content/lib/internal/dao.previews.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 verifyClientAuthentication has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const verifyClientAuthentication = function (clientId, clientSecret, callback) {
  OAuthDAO.Clients.getClientById(clientId, (error, client) => {
    if (error) {
      return callback(error);
    }
Severity: Minor
Found in packages/oae-authentication/lib/strategies/oauth/rest.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 authenticate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

Strategy.prototype.authenticate = function (request) {
  /*
   * If the user has authenticated through Shibboleth and is returning from the Identity Provider (IdP),
   * there should be a `shib-session-id` header in the request. If the user is indicating that he
   * wants to log in with Shibboleth, no such header will be present.
Severity: Minor
Found in packages/oae-authentication/lib/strategies/shibboleth/strategy.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 _getFullFolderProfile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const _getFullFolderProfile = function (ctx, folder, callback) {
  AuthzPermissions.resolveEffectivePermissions(ctx, folder, (error, permissions) => {
    if (error) {
      return callback(error);
    }
Severity: Minor
Found in packages/oae-folders/lib/api.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