Bamieh/reflow

View on GitHub

Showing 112 of 112 total issues

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

async function getIOSDevices() {
console.log('Getting iOS Devices.');
const result = await execAsync('xcrun instruments -s devices');
const devices = result.stdout
.split('\n')
Severity: Major
Found in packages/reflow-appium/lib/routes/devices.js and 1 other location - About 1 day to fix
packages/reflow-appium/lib/devices.js on lines 58..72

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

async function getIOSDevices() {
console.log('Getting iOS Devices.');
const result = await execAsync('xcrun instruments -s devices');
const devices = result.stdout
.split('\n')
Severity: Major
Found in packages/reflow-appium/lib/devices.js and 1 other location - About 1 day to fix
packages/reflow-appium/lib/routes/devices.js on lines 58..72

Function ReflowReporter has 164 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ReflowReporter = function(runner, options = {}) {
const reporterOptions = options.reporterOptions || {};
const {
combinationID,
flowDetails,
Severity: Major
Found in packages/reflow-reporter/index.js - About 6 hrs to fix

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

    describe('Suite C', function() {
    before(function() {
    console.log('I AM IN SUITE C!!!!!!!!!!!');
    return new Promise((resolve, reject) => {
    setTimeout(resolve, 600)
    Severity: Major
    Found in examples/example-e2e-project/suites/suite-c.spec.js and 1 other location - About 4 hrs to fix
    examples/example-native-project/suites/suite-c.spec.js on lines 1..14

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

    describe('Suite C', function() {
    before(function() {
    console.log('I AM IN SUITE C!!!!!!!!!!!');
    return new Promise((resolve, reject) => {
    setTimeout(resolve, 600)
    Severity: Major
    Found in examples/example-native-project/suites/suite-c.spec.js and 1 other location - About 4 hrs to fix
    examples/example-e2e-project/suites/suite-c.spec.js on lines 1..14

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

    async function systemProfiler(dataTypes) {
     
    const result = await execAsync('/usr/sbin/system_profiler -xml -detailLevel mini ' + dataTypes.join(' '));
     
    return plist.parse(result.stdout.toString()).reduce((acc, sec) => {
    Severity: Major
    Found in packages/reflow-appium/lib/routes/devices.js and 1 other location - About 4 hrs to fix
    packages/reflow-appium/lib/devices.js on lines 6..17

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

    async function systemProfiler(dataTypes) {
     
    const result = await execAsync('/usr/sbin/system_profiler -xml -detailLevel mini ' + dataTypes.join(' '));
     
    return plist.parse(result.stdout.toString()).reduce((acc, sec) => {
    Severity: Major
    Found in packages/reflow-appium/lib/devices.js and 1 other location - About 4 hrs to fix
    packages/reflow-appium/lib/routes/devices.js on lines 6..17

    Function createMatrixGenerator has 99 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const createMatrixGenerator = async function(reflowConfig: ReflowConfig) {
    const {
    // flowPaths,
    hooks,
    suites,
    Severity: Major
    Found in packages/reflow-core/src/generate-matrix.ts - About 3 hrs to fix

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

      router.get('/ios', async function(req, res) {
      try {
      const iOSDevices = await getIOSDevices();
      res.status(200).json(iOSDevices);
      } catch(err) {
      Severity: Major
      Found in packages/reflow-appium/lib/routes/devices.js and 1 other location - About 3 hrs to fix
      packages/reflow-appium/lib/routes/devices.js on lines 146..157

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

      router.get('/android', async function(req, res) {
      try {
      const androidDevices = await getAndroidDevices();
      res.status(200).json(androidDevices);
      } catch(err) {
      Severity: Major
      Found in packages/reflow-appium/lib/routes/devices.js and 1 other location - About 3 hrs to fix
      packages/reflow-appium/lib/routes/devices.js on lines 159..170

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

      function extractDeviceDetails(line) {
      const match = line.match(INSTRUMENTS_RE);
      if(!match) return null;
      const uuid = match[4];
      const platformVersion = match[3];
      Severity: Major
      Found in packages/reflow-appium/lib/devices.js and 1 other location - About 3 hrs to fix
      packages/reflow-appium/lib/routes/devices.js on lines 45..57

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

      function extractDeviceDetails(line) {
      const match = line.match(INSTRUMENTS_RE);
      if(!match) return null;
      const uuid = match[4];
      const platformVersion = match[3];
      Severity: Major
      Found in packages/reflow-appium/lib/routes/devices.js and 1 other location - About 3 hrs to fix
      packages/reflow-appium/lib/devices.js on lines 45..57

      Function insert has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      insert(input) {
      const jobsByProjectID = new models.instance.jobsByProjectId({
      project_id: models.datatypes.Long.fromString(input.jobDetails.projectID || "6366977657833263104"),
      job_id: models.datatypes.Long.fromString(input.jobDetails.id),
      threads: input.jobDetails.numberOfThreads,

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

        describe('Suite A', function() {
        before(function() {
        console.log('SUITE A BEFORE!')
        })
        it('does assertions', function(done) {
        examples/example-e2e-project/suites/nested/suite-a.spec.js on lines 3..16

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

        describe('Suite A', function() {
        before(function() {
        console.log('SUITE A BEFORE!')
        })
        it('does assertions', function(done) {
        Severity: Major
        Found in examples/example-e2e-project/suites/nested/suite-a.spec.js and 1 other location - About 3 hrs to fix
        examples/example-native-project/suites/nested/suite-a.spec.js on lines 3..16

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

        (async function() {
        const appiumInstance = new Appium();
        try {
        await appiumInstance.connect({
        throwInsteadOfExit: true,
        Severity: Major
        Found in examples/example-device/lib/node-3.js and 3 other locations - About 3 hrs to fix
        examples/example-device/lib/node-1.js on lines 5..19
        examples/example-device/lib/node-2.js on lines 5..19
        examples/example-device/lib/node-4.js on lines 5..19

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

        (async function() {
        const appiumInstance = new Appium();
        try {
        await appiumInstance.connect({
        throwInsteadOfExit: true,
        Severity: Major
        Found in examples/example-device/lib/node-1.js and 3 other locations - About 3 hrs to fix
        examples/example-device/lib/node-2.js on lines 5..19
        examples/example-device/lib/node-3.js on lines 5..19
        examples/example-device/lib/node-4.js on lines 5..19

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

        (async function() {
        const appiumInstance = new Appium();
        try {
        await appiumInstance.connect({
        throwInsteadOfExit: true,
        Severity: Major
        Found in examples/example-device/lib/node-4.js and 3 other locations - About 3 hrs to fix
        examples/example-device/lib/node-1.js on lines 5..19
        examples/example-device/lib/node-2.js on lines 5..19
        examples/example-device/lib/node-3.js on lines 5..19

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

        (async function() {
        const appiumInstance = new Appium();
        try {
        await appiumInstance.connect({
        throwInsteadOfExit: true,
        Severity: Major
        Found in examples/example-device/lib/node-2.js and 3 other locations - About 3 hrs to fix
        examples/example-device/lib/node-1.js on lines 5..19
        examples/example-device/lib/node-3.js on lines 5..19
        examples/example-device/lib/node-4.js on lines 5..19

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

        function getAndroidFeatures(devices) {
        return Promise.all(
        devices
        .filter(device => device.type !== 'unauthorized')
        .map(device => {
        Severity: Major
        Found in packages/reflow-appium/lib/routes/devices.js and 3 other locations - About 3 hrs to fix
        packages/reflow-appium/lib/devices.js on lines 23..32
        packages/reflow-appium/lib/devices.js on lines 33..42
        packages/reflow-appium/lib/routes/devices.js on lines 33..42
        Severity
        Category
        Status
        Source
        Language