Bamieh/reflow

View on GitHub

Showing 44 of 112 total issues

Function exports has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(opts) {
  const router = express.Router();
  let seleniumChild;
  router.get('/install', async function(req, res) {
    try {
Severity: Minor
Found in packages/reflow-grid/lib/routes/selenium-hub.js - About 1 hr to fix

    Function generateMatrix has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async function generateMatrix(filePath: string): Promise<MatrixEntries> {
        let finalResult: any = [];
    
        const reflowContext = createReflowContext()
        await runInSandbox(filePath, reflowContext)
    Severity: Minor
    Found in packages/reflow-core/src/generate-matrix.ts - About 1 hr to fix

      Function exports has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function(config) {
        const router = express.Router();
        let server;
      
        router.get('/doctor', async function(req, res) {
      Severity: Minor
      Found in packages/reflow-appium/lib/routes/appium.js - About 1 hr to fix

        Function exports has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = async function(config) {
          console.log('Binding models.');
          const bindModels = util.promisify(models.setDirectory( __dirname + '/models').bind);
        
          try {
        Severity: Minor
        Found in packages/reflow-cassandra-connection/lib/index.js - About 1 hr to fix

          Function runFlows has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            runFlows() {
              const flowsList = Object.values(this.flows);
              console.log(`${flowsList.length} total flows.`)
              let totalCombinations = 0;
              const matrices = flowsList.map(({name, fn}) => {
          Severity: Minor
          Found in packages/reflow-core/src/reflow.ts - About 1 hr to fix

            Function createReflowContext has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const createReflowContext = () => {
                const matrix:MatrixEntries = [];
                const reflowContext = {
                  matrix,
                  flow(title: Title, flowDetails: any) {
            Severity: Minor
            Found in packages/reflow-core/src/_generate-matrix.ts - About 1 hr to fix

              Function _execute has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              async function _execute (elementId, methodName, args = [], skipScreenshotAndSource = false) {
                let cachedEl;
                let res = {};
              
                if (elementId) {
              Severity: Minor
              Found in examples/example-native-project/actions/execute/command.js - About 1 hr to fix

                Function sendRequest has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function sendRequest(type, data) {
                    process.stdout.write(`\nSending request (${type}) to: ${hostname}:${port}${path}`);
                    const postData = JSON.stringify(data);
                    const contentLength = Buffer.byteLength(postData);
                    const reqOptions = {
                Severity: Minor
                Found in packages/reflow-reporter/index.js - About 1 hr to fix

                  Function _execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  async function _execute (elementId, methodName, args = [], skipScreenshotAndSource = false) {
                    let cachedEl;
                    let res = {};
                  
                    if (elementId) {
                  Severity: Minor
                  Found in examples/example-native-project/actions/execute/command.js - About 1 hr 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 render has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render() {
                      const { match, data } = this.props;
                      const projectName = match.params.projectName;
                      const selectedJobID = match.params.jobID;
                  
                  
                  Severity: Minor
                  Found in packages/reflow-board/src/pages/FlowsPage/Page.js - About 1 hr to fix

                    Function createReflowContext has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const createReflowContext = function(filepath) {
                      const self = this;
                      return {
                        describe(name) {
                          self.suites[name] = filepath
                    Severity: Minor
                    Found in packages/reflow-core/lib/reflow.js - About 1 hr 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 evaluateFlow has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const evaluateFlow = function(suites, activeTags) {
                      const formattedSuites = suites
                        .filter(Boolean)
                        .map(branch => _.isArray(branch)? branch : [branch])
                        .filter(branch => _.isMatch(branch[0].tags, activeTags))
                    Severity: Minor
                    Found in packages/reflow-core/lib/evaluate.js - About 1 hr 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 evaluateFlow has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const evaluateFlow = function(suites, activeTags) {
                      const formattedSuites = suites
                        .filter(Boolean)
                        .map(branch => Array.isArray(branch)? branch : [branch])
                        .filter(branch => isMatch(branch[0].tags, activeTags))
                    Severity: Minor
                    Found in packages/reflow-core/src/evaluate.ts - About 1 hr 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 createReflowContext has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const createReflowContext = function(filepath) {
                      const self = this;
                      return {
                        describe(name) {
                          self.suites[name] = filepath
                    Severity: Minor
                    Found in packages/reflow-core/src/context.ts - About 1 hr 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 installSelenium has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const installSelenium = function(opts={}) {
                      let lastPercentage;
                      return installSeleniumAsync({
                        // check for more recent versions of selenium here:
                        // https://selenium-release.storage.googleapis.com/index.html
                    Severity: Minor
                    Found in packages/reflow-grid/lib/selenium.js - About 1 hr to fix

                      Function getFlow has 26 lines of code (exceeds 25 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 1 hr to fix

                        Function parseDir has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const parseDir = function parseDir(callerFilename, opts) {
                          opts = opts || {}
                          // disable recursion to support nested directories of subcommands
                          if (typeof opts.recurse !== 'boolean') opts.recurse = true
                          // exclude 'json', 'coffee' from require-directory defaults
                        Severity: Minor
                        Found in packages/reflow-core/src/utils/parse-dir.ts - About 55 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 parseDir has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const parseDir = function parseDir(dir, callerFilename, opts) {
                          opts = opts || {}
                          // disable recursion to support nested directories of subcommands
                          if (typeof opts.recurse !== 'boolean') opts.recurse = true
                          // exclude 'json', 'coffee' from require-directory defaults
                        Severity: Minor
                        Found in packages/reflow-cli/bin/parse-dir.js - About 55 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 parseDir has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const parseDir = function parseDir(callerFilename, opts) {
                          opts = opts || {}
                          // disable recursion to support nested directories of subcommands
                          if (typeof opts.recurse !== 'boolean') opts.recurse = true
                          // exclude 'json', 'coffee' from require-directory defaults
                        Severity: Minor
                        Found in packages/reflow-core/lib/utils/parse-dir.js - About 55 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 ReflowReporter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const ReflowReporter = function(runner, options = {}) {
                          const reporterOptions = options.reporterOptions || {};
                          const {
                            combinationID,
                            flowDetails,
                        Severity: Minor
                        Found in packages/reflow-reporter/index.js - About 55 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