Bamieh/reflow

View on GitHub

Showing 44 of 112 total issues

Function getFlow has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const getFlow = function(): Flow {
  const flowObjects: FlowObject = {};
  return {
    get(name: string, fallback: any): void {
      const flowObject = flowObjects[name];
Severity: Minor
Found in packages/reflow-client/src/commands/flow-variables.ts - About 45 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 getSourceAndScreenshot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

async function getSourceAndScreenshot (driver) {
  let source, sourceError, screenshot, screenshotError;
  try {
    source = await driver.source();
  } catch (e) {
Severity: Minor
Found in examples/example-native-project/actions/execute/command.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 handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

exports.handler = function (config) {
  console.log('config::', config)
  const _ = require('lodash');
  const path = require('path');
  const fs = require('fs');
Severity: Minor
Found in packages/reflow-cli/bin/commands/run.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 createMatrixGenerator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const createMatrixGenerator = async function(reflowConfig: ReflowConfig) {
  const {
    // flowPaths,
    hooks,
    suites,
Severity: Minor
Found in packages/reflow-core/src/_generate-matrix.ts - 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