inventid/iaas

View on GitHub

Showing 25 of 43 total issues

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

function setup() {
  const influxConnection = config.get("metrics.influx.dsn");
  const influx = new InfluxDB(influxConnection);
  log('debug', `Connecting influx to ${influxConnection}`);

Severity: Minor
Found in src/metrics/influx.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 startMigrations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default async function startMigrations() {
  if (!canNodeRunMigration()) {
    return;
  }

Severity: Minor
Found in src/migrations/index.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 fit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const fit = async (client, params) => {
  //For original format
  if (!params.width || !params.height) {
    return client;
  }
Severity: Minor
Found in src/image.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 metricFromParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function metricFromParams(params, type = REQUEST) {
  // The -1 handles the case where an original image was requested
  const fields = {
    name: params.name,
    width: params.width || -1,
Severity: Minor
Found in src/metrics/index.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 writeOriented has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export async function writeOriented(source, destination, cropParameters) {
  // if possible, crop first (since the UA had that orientation), then orient
  if (cropParameters) {
    const cropped = im(source).options(gmOptions)
      .crop(cropParameters.width, cropParameters.height, cropParameters.xOffset, cropParameters.yOffset);
Severity: Minor
Found in src/image.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