ModusCreateOrg/budgeting

View on GitHub

Showing 25 of 25 total issues

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

describe('getFormattedBalance', () => {
it('should return formatted object of the sum of values of every transactions', () => {
const state = { transactions: [{ value: 10 }, { value: -50 }, { value: 70 }] };
const expectedSelection = {
text: '$30.00',
Severity: Major
Found in app/selectors/__tests__/transactions-test.js and 1 other location - About 2 days to fix
app/selectors/__tests__/transactions-test.js on lines 164..207

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

describe('getFormattedInflowBalance', () => {
it('should return formatted object of the sum of values of every positive transactions', () => {
const state = { transactions: [{ value: 10 }, { value: -50 }, { value: 70 }] };
const expectedSelection = {
text: '$80.00',
Severity: Major
Found in app/selectors/__tests__/transactions-test.js and 1 other location - About 2 days to fix
app/selectors/__tests__/transactions-test.js on lines 119..162

File transactions-test.js has 309 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
sortTransactions,
getTransactions,
getInflowBalance,
getOutflowBalance,
Severity: Minor
Found in app/selectors/__tests__/transactions-test.js - About 3 hrs to fix

    Function render has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    render() {
    const { categories, defaultCategoryId, transaction, setEditTransaction } = this.props;
    const id = transaction ? transaction.id : '';
    const initialValues = {
    id,
    Severity: Major
    Found in app/containers/EntryFormRow/index.js - About 2 hrs to fix

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

      it('renders a working component', () => {
      const tree = renderer
      .create(
      <ErrorBoundary fallbackComponent={FallbackComponent}>
      <WorkingComponent />
      Severity: Major
      Found in app/components/ErrorBoundary/__tests__/index-test.js and 1 other location - About 2 hrs to fix
      app/components/ErrorBoundary/__tests__/index-test.js on lines 30..39

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

      it('renders a fallback component when the children component fails', () => {
      const tree = renderer
      .create(
      <ErrorBoundary fallbackComponent={FallbackComponent}>
      <FailingComponent />
      Severity: Major
      Found in app/components/ErrorBoundary/__tests__/index-test.js and 1 other location - About 2 hrs to fix
      app/components/ErrorBoundary/__tests__/index-test.js on lines 19..28

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

      const state1 = {
      transactions: [
      { value: -10, categoryId: 1 },
      { value: -50, categoryId: 1 },
      { value: 70, categoryId: 2 },
      Severity: Major
      Found in app/selectors/__tests__/transactions-test.js and 1 other location - About 1 hr to fix
      app/selectors/__tests__/transactions-test.js on lines 256..263

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

      const state = {
      transactions: [
      { value: -10, categoryId: 1 },
      { value: -50, categoryId: 1 },
      { value: 70, categoryId: 2 },
      Severity: Major
      Found in app/selectors/__tests__/transactions-test.js and 1 other location - About 1 hr to fix
      app/selectors/__tests__/transactions-test.js on lines 289..296

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

      ): HigherOrderComponent<{}, ProvidedProps> => WrappedComponent => {
      class ConsumeContextBroadcast extends React.Component<any, ConsumeContextBroadcastState> {
      static contextTypes = {
      [broadcastName]: PropTypes.object,
      };
      Severity: Minor
      Found in app/utils/consumeContextBroadcast.js - About 1 hr to fix

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

        const state = {
        transactions: [
        { value: 10, categoryId: 1 },
        { value: 50, categoryId: 1 },
        { value: -70, categoryId: 2 },
        Severity: Major
        Found in app/selectors/__tests__/transactions-test.js and 1 other location - About 1 hr to fix
        app/selectors/__tests__/transactions-test.js on lines 350..357

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

        const state1 = {
        transactions: [
        { value: 10, categoryId: 1 },
        { value: 50, categoryId: 1 },
        { value: -70, categoryId: 2 },
        Severity: Major
        Found in app/selectors/__tests__/transactions-test.js and 1 other location - About 1 hr to fix
        app/selectors/__tests__/transactions-test.js on lines 317..324

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

        <td>
        <div className={styles.cellLabel}>Category</div>
        <div className={styles.cellContent}>{category}</div>
        </td>
        Severity: Major
        Found in app/components/BudgetGridRow/index.js and 1 other location - About 1 hr to fix
        app/components/BudgetGridRow/index.js on lines 25..28

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

        <td>
        <div className={styles.cellLabel}>Description</div>
        <div className={styles.cellContent}>{description}</div>
        </td>
        Severity: Major
        Found in app/components/BudgetGridRow/index.js and 1 other location - About 1 hr to fix
        app/components/BudgetGridRow/index.js on lines 21..24

        Function render has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        render() {
        const { xScale, yScale, colorFn, dataKeys, boxLength, boxHeight, chartPadding } = this;
        const { data, totals, dataKey, dataLabel, dataValue } = this.props;
         
        return (
        Severity: Minor
        Found in app/components/StackedChart/StackedChart.js - About 1 hr to fix

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

          it('renders correctly', () => {
          const tree = renderer.create(<ReportsTabbar />).toJSON();
          expect(tree).toMatchSnapshot();
          });
          app/components/AppError/__tests__/index-test.js on lines 5..8
          app/components/Header/__tests__/Logo-test.js on lines 5..8
          app/components/Header/__tests__/index-test.js on lines 10..13
          app/components/Loading/__tests__/index-test.js on lines 5..8
          app/components/ReportsPanel/__tests__/index-test.js on lines 9..12

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

          it('renders correctly', () => {
          const tree = renderer.create(<AppError />).toJSON();
          expect(tree).toMatchSnapshot();
          });
          Severity: Major
          Found in app/components/AppError/__tests__/index-test.js and 5 other locations - About 1 hr to fix
          app/components/Header/__tests__/Logo-test.js on lines 5..8
          app/components/Header/__tests__/index-test.js on lines 10..13
          app/components/Loading/__tests__/index-test.js on lines 5..8
          app/components/ReportsPanel/__tests__/ReportsTabbar-test.js on lines 8..11
          app/components/ReportsPanel/__tests__/index-test.js on lines 9..12

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

          it('renders correctly', () => {
          const tree = renderer.create(<ReportsPanel />).toJSON();
          expect(tree).toMatchSnapshot();
          });
          Severity: Major
          Found in app/components/ReportsPanel/__tests__/index-test.js and 5 other locations - About 1 hr to fix
          app/components/AppError/__tests__/index-test.js on lines 5..8
          app/components/Header/__tests__/Logo-test.js on lines 5..8
          app/components/Header/__tests__/index-test.js on lines 10..13
          app/components/Loading/__tests__/index-test.js on lines 5..8
          app/components/ReportsPanel/__tests__/ReportsTabbar-test.js on lines 8..11

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

          it('renders correctly', () => {
          const tree = renderer.create(<Loading />).toJSON();
          expect(tree).toMatchSnapshot();
          });
          Severity: Major
          Found in app/components/Loading/__tests__/index-test.js and 5 other locations - About 1 hr to fix
          app/components/AppError/__tests__/index-test.js on lines 5..8
          app/components/Header/__tests__/Logo-test.js on lines 5..8
          app/components/Header/__tests__/index-test.js on lines 10..13
          app/components/ReportsPanel/__tests__/ReportsTabbar-test.js on lines 8..11
          app/components/ReportsPanel/__tests__/index-test.js on lines 9..12

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

          it('renders correctly', () => {
          const tree = renderer.create(<Logo />).toJSON();
          expect(tree).toMatchSnapshot();
          });
          Severity: Major
          Found in app/components/Header/__tests__/Logo-test.js and 5 other locations - About 1 hr to fix
          app/components/AppError/__tests__/index-test.js on lines 5..8
          app/components/Header/__tests__/index-test.js on lines 10..13
          app/components/Loading/__tests__/index-test.js on lines 5..8
          app/components/ReportsPanel/__tests__/ReportsTabbar-test.js on lines 8..11
          app/components/ReportsPanel/__tests__/index-test.js on lines 9..12

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

          it('renders correctly', () => {
          const tree = renderer.create(<Header />).toJSON();
          expect(tree).toMatchSnapshot();
          });
          Severity: Major
          Found in app/components/Header/__tests__/index-test.js and 5 other locations - About 1 hr to fix
          app/components/AppError/__tests__/index-test.js on lines 5..8
          app/components/Header/__tests__/Logo-test.js on lines 5..8
          app/components/Loading/__tests__/index-test.js on lines 5..8
          app/components/ReportsPanel/__tests__/ReportsTabbar-test.js on lines 8..11
          app/components/ReportsPanel/__tests__/index-test.js on lines 9..12
          Severity
          Category
          Status
          Source
          Language