TryGhost/Ghost

View on GitHub
apps/admin-x-demo/src/DetailPage.tsx

Summary

Maintainability
D
1 day
Test Coverage

Function DetailPage has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const DetailPage: React.FC = () => {
    const {updateRoute} = useRouting();

    return (
        <Page
Severity: Major
Found in apps/admin-x-demo/src/DetailPage.tsx - About 5 hrs to fix

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

                            <div className='flex justify-between'>
                                <Heading level={5}>Member data</Heading>
                                <Button color='green' label='Edit' link />
                            </div>
    Severity: Major
    Found in apps/admin-x-demo/src/DetailPage.tsx and 1 other location - About 1 hr to fix
    apps/admin-x-demo/src/DetailPage.tsx on lines 124..127

    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 58.

    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

    Further Reading

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

                            <div className='flex justify-between'>
                                <Heading level={5}>Activity</Heading>
                                <Button color='green' label='View all' link />
                            </div>
    Severity: Major
    Found in apps/admin-x-demo/src/DetailPage.tsx and 1 other location - About 1 hr to fix
    apps/admin-x-demo/src/DetailPage.tsx on lines 66..69

    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 58.

    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

    Further Reading

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

                            <div className='flex flex-col text-sm'>
                                <span className='font-semibold'>Subscribed to Daily News</span>
                                <span className='text-sm text-grey-500'>17 days ago</span>
                            </div>
    Severity: Major
    Found in apps/admin-x-demo/src/DetailPage.tsx and 5 other locations - About 55 mins to fix
    apps/admin-x-demo/src/DetailPage.tsx on lines 80..83
    apps/admin-x-demo/src/DetailPage.tsx on lines 117..120
    apps/admin-x-demo/src/DetailPage.tsx on lines 128..131
    apps/admin-x-demo/src/DetailPage.tsx on lines 136..139
    apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx on lines 480..483

    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 53.

    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

    Further Reading

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

                                <div className='flex flex-col'>
                                    <span className='font-semibold'>Gold</span>
                                    <span className='text-sm text-grey-500'>Renews 21 Jan 2024</span>
                                </div>
    Severity: Major
    Found in apps/admin-x-demo/src/DetailPage.tsx and 5 other locations - About 55 mins to fix
    apps/admin-x-demo/src/DetailPage.tsx on lines 80..83
    apps/admin-x-demo/src/DetailPage.tsx on lines 128..131
    apps/admin-x-demo/src/DetailPage.tsx on lines 132..135
    apps/admin-x-demo/src/DetailPage.tsx on lines 136..139
    apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx on lines 480..483

    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 53.

    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

    Further Reading

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

                                <div className='mt-2 flex gap-1'>
                                    <div className='inline-block rounded-sm bg-grey-200 px-1.5 text-xs font-medium'>VIP</div>
                                    <div className='inline-block rounded-sm bg-grey-200 px-1.5 text-xs font-medium'>Inner Circle</div>
                                </div>
    Severity: Major
    Found in apps/admin-x-demo/src/DetailPage.tsx and 5 other locations - About 55 mins to fix
    apps/admin-x-demo/src/DetailPage.tsx on lines 117..120
    apps/admin-x-demo/src/DetailPage.tsx on lines 128..131
    apps/admin-x-demo/src/DetailPage.tsx on lines 132..135
    apps/admin-x-demo/src/DetailPage.tsx on lines 136..139
    apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx on lines 480..483

    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 53.

    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

    Further Reading

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

                            <div className='flex flex-col text-sm'>
                                <span className='font-semibold'>Logged in</span>
                                <span className='text-sm text-grey-500'>21 days ago</span>
                            </div>
    Severity: Major
    Found in apps/admin-x-demo/src/DetailPage.tsx and 5 other locations - About 55 mins to fix
    apps/admin-x-demo/src/DetailPage.tsx on lines 80..83
    apps/admin-x-demo/src/DetailPage.tsx on lines 117..120
    apps/admin-x-demo/src/DetailPage.tsx on lines 128..131
    apps/admin-x-demo/src/DetailPage.tsx on lines 132..135
    apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx on lines 480..483

    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 53.

    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

    Further Reading

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

                            <div className='flex flex-col text-sm'>
                                <span className='font-semibold'>Logged in</span>
                                <span className='text-sm text-grey-500'>13 days ago</span>
                            </div>
    Severity: Major
    Found in apps/admin-x-demo/src/DetailPage.tsx and 5 other locations - About 55 mins to fix
    apps/admin-x-demo/src/DetailPage.tsx on lines 80..83
    apps/admin-x-demo/src/DetailPage.tsx on lines 117..120
    apps/admin-x-demo/src/DetailPage.tsx on lines 132..135
    apps/admin-x-demo/src/DetailPage.tsx on lines 136..139
    apps/admin-x-settings/src/components/settings/email/newsletters/NewsletterDetailModal.tsx on lines 480..483

    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 53.

    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

    Further Reading

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

                            <div>
                                <Heading level={6}>Email</Heading>
                                <div>emerson@vaccaro.com</div>
                            </div>
    Severity: Minor
    Found in apps/admin-x-demo/src/DetailPage.tsx and 1 other location - About 30 mins to fix
    apps/admin-x-demo/src/DetailPage.tsx on lines 70..73

    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 45.

    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

    Further Reading

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

                            <div>
                                <Heading level={6}>Name</Heading>
                                <div>Emerson Vaccaro</div>
                            </div>
    Severity: Minor
    Found in apps/admin-x-demo/src/DetailPage.tsx and 1 other location - About 30 mins to fix
    apps/admin-x-demo/src/DetailPage.tsx on lines 74..77

    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 45.

    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

    Further Reading

    There are no issues that match your filters.

    Category
    Status