Bamieh/reflow

View on GitHub

Showing 112 of 112 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const status = {
  Header: "status",
  columns: [{
    Header: "Status",
    accessor: "node.result",
Severity: Major
Found in packages/reflow-board/src/pages/CombinationsList/columns.js and 1 other location - About 1 hr to fix
packages/reflow-board/src/containers/FlowsList/columns.js on lines 9..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    function pluckDevices(dataTypes) {
      return dataTypes
        .find(dataType => dataType.name === 'SPUSBDataType')
        .items._items
        .filter(item => !!item.serial_num);
    Severity: Major
    Found in packages/reflow-appium/lib/devices.js and 1 other location - About 1 hr to fix
    packages/reflow-appium/lib/routes/devices.js on lines 104..109

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    function pluckDevices(dataTypes) {
      return dataTypes
        .find(dataType => dataType.name === 'SPUSBDataType')
        .items._items
        .filter(item => !!item.serial_num);
    Severity: Major
    Found in packages/reflow-appium/lib/routes/devices.js and 1 other location - About 1 hr to fix
    packages/reflow-appium/lib/devices.js on lines 104..109

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      hook("Hook C", function() {
        return {
          before() {
            console.log('Hook C Before!')
            return new Promise(resolve => {
      Severity: Major
      Found in examples/example-native-project/hooks/hook-c.js and 1 other location - About 1 hr to fix
      examples/example-e2e-project/hooks/hook-c.js on lines 1..10

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      hook("Hook C", function() {
        return {
          before() {
            console.log('Hook C Before!')
            return new Promise(resolve => {
      Severity: Major
      Found in examples/example-e2e-project/hooks/hook-c.js and 1 other location - About 1 hr to fix
      examples/example-native-project/hooks/hook-c.js on lines 1..10

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 57.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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/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

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

          constructor(props) {
            super(props);
            this.state = {
              showCode: false,
            }
        Severity: Major
        Found in packages/reflow-board/src/components/Suite/index.js and 3 other locations - About 1 hr to fix
        packages/reflow-board/src/components/Suite/index.js on lines 24..30
        packages/reflow-board/src/pages/CombinationReport/Page.js on lines 9..15
        packages/reflow-board/src/pages/CombinationsList/Page.js on lines 15..21

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

        describe('Standard Suite', function() {
          it('Runs Cases', function() {
            expect(1).to.equal(1);
            console.log('Standard Suite Case Invoked')
          })
        packages/reflow-core/__test/fixture/suite/suite-a.js on lines 1..6
        packages/reflow-core/__test/fixture/suite/suite-b.js on lines 1..6
        packages/reflow-core/__test/fixture/suite/suite-c.js on lines 1..6

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

          constructor(props) {
            super(props);
            this.state = {
              showCode: false,
            }
        Severity: Major
        Found in packages/reflow-board/src/components/Suite/index.js and 3 other locations - About 1 hr to fix
        packages/reflow-board/src/components/Suite/index.js on lines 76..82
        packages/reflow-board/src/pages/CombinationReport/Page.js on lines 9..15
        packages/reflow-board/src/pages/CombinationsList/Page.js on lines 15..21

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

          constructor(props) {
            super(props);
            this.state = {
              onlyFailures: false,
            }
        Severity: Major
        Found in packages/reflow-board/src/pages/CombinationsList/Page.js and 3 other locations - About 1 hr to fix
        packages/reflow-board/src/components/Suite/index.js on lines 24..30
        packages/reflow-board/src/components/Suite/index.js on lines 76..82
        packages/reflow-board/src/pages/CombinationReport/Page.js on lines 9..15

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

          constructor(props) {
            super(props)
            this.state = {
              onlyFailures: false,
            }
        Severity: Major
        Found in packages/reflow-board/src/pages/CombinationReport/Page.js and 3 other locations - About 1 hr to fix
        packages/reflow-board/src/components/Suite/index.js on lines 24..30
        packages/reflow-board/src/components/Suite/index.js on lines 76..82
        packages/reflow-board/src/pages/CombinationsList/Page.js on lines 15..21

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

        describe('Suite C', function() {
          it('Runs Cases', function() {
            expect(1).to.equal(1);
            console.log('Another Standard Suite Case Invoked')
          })
        Severity: Major
        Found in packages/reflow-core/__test/fixture/suite/suite-c.js and 3 other locations - About 1 hr to fix
        packages/reflow-core/__test/fixture/suite/standard-describe.js on lines 1..6
        packages/reflow-core/__test/fixture/suite/suite-a.js on lines 1..6
        packages/reflow-core/__test/fixture/suite/suite-b.js on lines 1..6

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

        describe('Suite A', function() {
          it('Runs Cases', function() {
            expect(1).to.equal(1);
            console.log('Another Standard Suite Case Invoked')
          })
        Severity: Major
        Found in packages/reflow-core/__test/fixture/suite/suite-a.js and 3 other locations - About 1 hr to fix
        packages/reflow-core/__test/fixture/suite/standard-describe.js on lines 1..6
        packages/reflow-core/__test/fixture/suite/suite-b.js on lines 1..6
        packages/reflow-core/__test/fixture/suite/suite-c.js on lines 1..6

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language