Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lint rule for one React component per file #5113

Merged
merged 3 commits into from
Dec 13, 2023
Merged

Add lint rule for one React component per file #5113

merged 3 commits into from
Dec 13, 2023

Conversation

sroy3
Copy link
Contributor

@sroy3 sroy3 commented Dec 13, 2023

We have mentioned this before, but seems like it keeps happening.

@sroy3 sroy3 self-assigned this Dec 13, 2023
@sroy3 sroy3 marked this pull request as ready for review December 13, 2023 17:09
size: DEFAULT_COLUMN_WIDTH
}

export const ExperimentsTable: React.FC = () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ExperimentsTable has 67 lines of code (exceeds 40 allowed). Consider refactoring.

import { Modal } from '../../shared/components/modal/Modal'
import { PlotsState } from '../store'

export const PlotsContent = () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PlotsContent has 72 lines of code (exceeds 40 allowed). Consider refactoring.


export const PlotsContent = () => {
const dispatch = useDispatch()
const { hasData, hasPlots, hasUnselectedPlots, zoomedInPlot, cliError } =
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

import React, { PropsWithChildren } from 'react'
import styles from './styles.module.scss'

export const PathHighlight: React.FC<PropsWithChildren> = ({ children }) => (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


export const PlotsContent = () => {
const dispatch = useDispatch()
const { hasData, hasPlots, hasUnselectedPlots, zoomedInPlot, cliError } =
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 5 locations. Consider refactoring.

Copy link

codeclimate bot commented Dec 13, 2023

Code Climate has analyzed commit d1122ac and detected 5 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2
Duplication 3

The test coverage on the diff in this pull request is 99.1% (85% is the threshold).

This pull request will bring the total coverage in the repository to 95.2%.

View more on Code Climate.

@sroy3 sroy3 merged commit 85454db into main Dec 13, 2023
6 of 8 checks passed
@sroy3 sroy3 deleted the one-component branch December 13, 2023 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants