Showing 262 of 262 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
data.map((item: DynamicData, idx: number) => (
<div
className="product_card bg-neutral-white p-4 flex flex-col rounded-md shadow laptop:max-w-[100%] h-full"
key={idx}
>
- Read upRead up
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 539.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
data.slice(0, 8).map((item: DynamicData, idx: number) => (
<div
className="product_card bg-neutral-white p-4 flex flex-col rounded-md shadow laptop:max-w-[100%] h-full"
key={idx}
>
- Read upRead up
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 539.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
const UserRedirection = () => {
const navigate = useNavigate();
const { isResetPassword } = useAppSelector((state) => state.forgotPassword);
useEffect(() => {
if (!isResetPassword) {
- Read upRead up
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 364.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
const SellerRedirection = () => {
const navigate = useNavigate();
const { requires2FA } = useAppSelector((state) => state.login);
useEffect(() => {
- Read upRead up
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 364.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
const CopyButton: FC<CopyType> = ({ name, text, value }) => {
const [copied, setCopied] = useState(false);
useEffect(() => {
const interval = setTimeout(() => {
- Read upRead up
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 274.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
const CopyCard: FC<CopyType> = ({ name, text, value }) => {
const [copied, setCopied] = useState(false);
useEffect(() => {
const interval = setTimeout(() => {
- Read upRead up
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 274.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
data.map((item: DynamicData) => (
<div
className="single-review mt-4 border-t pt-4 border-inputCaption flex flex-col gap-3 ipad:flex-ow ipad:gap11 ipad:justify-between "
key={item.id}
>
- Read upRead up
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 248.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
review.slice(0, 2).map((item: DynamicData) => (
<div
className="single-review mt-4 border-t pt-4 border-inputCaption flex flex-col gap-3 ipad:flex-ow ipad:gap11 ipad:justify-between "
key={item.id}
>
- Read upRead up
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 248.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function ProfileUser
has 254 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ProfileUser = () => {
const dispatch = useAppDispatch();
const { data, isLoading, error } = useAppSelector((state) => state.profile);
const [selectedImage, setSelectedImage] = useState<File | null>(null);
const { showErrorMessage, showSuccessMessage } = useToast();
Function PaymentToggleModel
has 253 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PaymentToggleModel() {
const navigate = useNavigate();
const dispatch = useAppDispatch();
const [current, setCurrent] = useState(0);
const [previousStep, setPreviousStep] = useState(0);
Function AddEditProductForm
has 247 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AddEditProductForm = () => {
const location = useLocation();
const navigate = useNavigate();
const dispatch = useAppDispatch();
const { showErrorMessage, showSuccessMessage } = useToast();
Function SingleProduct
has 245 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SingleProduct = () => {
const { isLoading, singleProduct } = useAppSelector((state) => state.product);
const dispatch = useAppDispatch();
const review = useAppSelector(
Function EditUserForm
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EditUserForm = (props: userFormType) => {
const roles = useAppSelector(
(state) => state.allRoles.data[state.allRoles.data.length - 1],
);
const roleLoading = useAppSelector((state) => state.allRoles.isLoading);
Function GetUser
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
const GetUser = (props: getUserType) => {
const [currentPage, setCurrentPage] = useState(0);
const [searchQuery, setSearchQuery] = useState('');
const [butOverlay, setButOverlay] = useState('');
const roles = useAppSelector((state) => state.allRoles?.data[0]);
Function ProductsPage
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ProductsPage = () => {
const [openFilter, setOpenFilter] = useState(false);
const { isLoading, products } = useAppSelector((state) => state.product);
const { data, searchInputs } = useAppSelector((state) => state.search);
const { carts } = useAppSelector((state) => state.cart);
Function SellerDashboard
has 186 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SellerDashboard = () => {
const dispatch = useAppDispatch();
const { show } = useHandleResize();
const [VALUES, setVALUES] = useState(initialValues);
const { isLoading, allSalesData } = useAppSelector((state) => state.sales);
Function AllReview
has 185 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AllReview(props: reviewType) {
const [ratingTab, setRatingTab] = useState(false);
const data = useAppSelector(
(state) => state.fetchReview.data[state.fetchReview.data.length - 1]?.data,
);
Function LandingProduct
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LandingProduct = () => {
const { isLoading, products } = useAppSelector((state) => state.product);
const { data, searchInputs } = useAppSelector((state) => state.search);
const [openModel, setOpenModel] = useState(false);
const [openFilter, setOpenFilter] = useState(false);
Function Contacts
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Contacts = () => {
const { show } = useHandleResize();
const dispatch = useAppDispatch();
const { isLoading } = useAppSelector((state) => state.queries);
const { showSuccessMessage, showErrorMessage } = useToast();
Function ReviewForm
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ReviewForm(props: reviewFormType) {
const [isEditMode, setIsEditMode] = useState(false);
const [rated, setRated] = useState(0);
const [reviewId, setReviewId] = useState('');
const dispatch = useAppDispatch();