smartprocure/futil-js

View on GitHub

Showing 20 of 20 total issues

File objects.spec.js has 885 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import chai from 'chai'
import * as F from '../src'
import _ from 'lodash/fp'
 
chai.expect()
Severity: Major
Found in test/objects.spec.js - About 2 days to fix

    File tree.spec.js has 636 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import chai from 'chai'
    import * as F from '../src'
    import _ from 'lodash/fp'
    import Promise from 'bluebird'
     
     
    Severity: Major
    Found in test/tree.spec.js - About 1 day to fix

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

      let tree = {
      type: 'object',
      additionalProperties: false,
      required: ['email', 'subscriptionType'],
      properties: {
      Severity: Major
      Found in test/tree.spec.js and 1 other location - About 7 hrs to fix
      test/tree.spec.js on lines 597..622

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

      expect(result).to.deep.equal({
      bsonType: 'object',
      additionalProperties: false,
      required: ['email', 'subscriptionType'],
      properties: {
      Severity: Major
      Found in test/tree.spec.js and 1 other location - About 7 hrs to fix
      test/tree.spec.js on lines 561..586

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

      it('matchesBy', () => {
      // support both values and comparator functions
      const test = F.matchesBy({
      a: (x) => x > 1,
      b: (x) => x == 2,
      Severity: Major
      Found in test/objects.spec.js and 1 other location - About 3 hrs to fix
      test/objects.spec.js on lines 943..952

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

      it('matchesBySome', () => {
      // support both values and comparator functions
      const test = F.matchesBySome({
      a: (x) => x > 1,
      b: (x) => x == 5,
      Severity: Major
      Found in test/objects.spec.js and 1 other location - About 3 hrs to fix
      test/objects.spec.js on lines 933..942

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

      it('flip', () => {
      let x = {
      a: 1,
      }
      F.flip('a', x)()
      Severity: Major
      Found in test/lens.spec.js and 1 other location - About 3 hrs to fix
      test/lens.spec.js on lines 151..163

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

      it('on', () => {
      let x = {
      a: 1,
      }
      F.on('a', x)()
      Severity: Major
      Found in test/lens.spec.js and 1 other location - About 3 hrs to fix
      test/lens.spec.js on lines 138..150

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

      module.exports = function (config) {
      'use strict'
       
      let browsers
      let reporters
      Severity: Major
      Found in karma.conf.js - About 2 hrs to fix

        Function getDocs has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        let getDocs = async () => {
        let jsDocToJson = _.flow(
        _.reject('undocumented'),
        _.reject({ kind: 'module' }),
        _.reject({ access: 'private' }),
        Severity: Major
        Found in scripts/generate-docs.js - About 2 hrs to fix

          File lens.spec.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import chai from 'chai'
          import _ from 'lodash/fp'
          import * as F from '../src'
           
          chai.expect()
          Severity: Minor
          Found in test/lens.spec.js - About 2 hrs to fix

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

            it('domLens.hover', () => {
            let state = {
            hovering: false,
            }
            let props = F.domLens.hover('hovering', state)
            Severity: Major
            Found in test/lens.spec.js and 1 other location - About 2 hrs to fix
            test/lens.spec.js on lines 246..255

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

            it('domLens.focus', () => {
            let state = {
            focusing: false,
            }
            let props = F.domLens.focus('focusing', state)
            Severity: Major
            Found in test/lens.spec.js and 1 other location - About 2 hrs to fix
            test/lens.spec.js on lines 236..245

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

            expect(
            F.simpleDiffArray(
            {
            x: 1,
            a: 3,
            Severity: Major
            Found in test/objects.spec.js and 1 other location - About 1 hr to fix
            test/objects.spec.js on lines 322..370

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

            expect(
            F.simpleDiff(
            {
            x: 1,
            a: 3,
            Severity: Major
            Found in test/objects.spec.js and 1 other location - About 1 hr to fix
            test/objects.spec.js on lines 373..427

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

            it('hasIn', () => {
            let hero = {
            name: 'Heracles',
            father: 'Zeus',
            bornAt: 'Thebes',
            Severity: Major
            Found in test/conversions.spec.js and 1 other location - About 1 hr to fix
            test/conversions.spec.js on lines 61..69

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

            it('includesIn', () => {
            let hero = {
            name: 'Heracles',
            father: 'Zeus',
            bornAt: 'Thebes',
            Severity: Major
            Found in test/conversions.spec.js and 1 other location - About 1 hr to fix
            test/conversions.spec.js on lines 29..37

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

            let callUnless = (check) => (failFn) => (fn) => (x, y) =>
            check(x) ? failFn(y) : check(y) ? failFn(x) : fn(x, y)
            Severity: Minor
            Found in src/array.js - About 55 mins to fix

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

            it('dotEncoder', () => {
            expect(F.dotEncoder.encode(['a', 'b'])).to.equal('a.b')
            expect(F.dotEncoder.decode('a.b')).to.deep.equal(['a', 'b'])
            })
            Severity: Minor
            Found in test/array.spec.js and 1 other location - About 45 mins to fix
            test/array.spec.js on lines 148..151

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

            it('slashEncoder', () => {
            expect(F.slashEncoder.encode(['a', 'b'])).to.equal('a/b')
            expect(F.slashEncoder.decode('a/b')).to.deep.equal(['a', 'b'])
            })
            Severity: Minor
            Found in test/array.spec.js and 1 other location - About 45 mins to fix
            test/array.spec.js on lines 144..147
            Severity
            Category
            Status
            Source
            Language