TryGhost/Ghost

View on GitHub
ghost/core/core/server/data/schema/schema.js

Summary

Maintainability
F
2 wks
Test Coverage

File schema.js has 1056 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* String Column Sizes Information
 * (From: https://github.com/TryGhost/Ghost/pull/7932)
 *
 * Small strings = length 50
 * Medium strings = length 191
Severity: Major
Found in ghost/core/core/server/data/schema/schema.js - About 2 days to fix

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

        email_recipient_failures: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            email_id: {type: 'string', maxlength: 24, nullable: false, references: 'emails.id'},
            member_id: {type: 'string', maxlength: 24, nullable: true},
            email_recipient_id: {type: 'string', maxlength: 24, nullable: false, references: 'email_recipients.id'},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 1 day to fix
    ghost/core/core/server/data/migrations/versions/5.25/2022-11-29-08-30-add-error-recipient-failures-table.js on lines 3..20

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

    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

        recommendations: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            url: {type: 'string', maxlength: 2000, nullable: false},
            title: {type: 'string', maxlength: 2000, nullable: false},
            excerpt: {type: 'string', maxlength: 2000, nullable: true},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 1 day to fix
    ghost/core/core/server/data/migrations/versions/5.61/2023-08-29-11-39-10-add-recommendations-table.js on lines 3..18

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

    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

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

        collections: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            title: {type: 'string', maxlength: 191, nullable: false},
            slug: {type: 'string', maxlength: 191, nullable: false, unique: true},
            description: {type: 'string', maxlength: 2000, nullable: true},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 7 hrs to fix
    ghost/core/core/server/data/migrations/versions/5.53/2023-06-20-10-18-add-collections-table.js on lines 5..15

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

    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

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

        jobs: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            name: {type: 'string', maxlength: 191, nullable: false, unique: true},
            status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'queued', validations: {isIn: [['started', 'finished', 'failed', 'queued']]}},
            started_at: {type: 'dateTime', nullable: true},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 6 hrs to fix
    ghost/core/core/server/data/migrations/versions/5.5/2022-07-21-08-56-add-jobs-table.js on lines 3..11

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

    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

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

        members_email_change_events: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true},
            to_email: {type: 'string', maxlength: 191, nullable: false, unique: false, validations: {isEmail: true}},
            from_email: {type: 'string', maxlength: 191, nullable: false, unique: false, validations: {isEmail: true}},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 5 hrs to fix
    ghost/core/core/server/data/migrations/versions/4.0/09-add-members-email-change-events-table.js on lines 3..9

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

    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

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

        members_feedback: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            score: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0},
            member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true},
            post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id', cascadeDelete: true},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 5 hrs to fix
    ghost/core/core/server/data/migrations/versions/5.19/2022-10-10-10-05-add-members-feedback-table.js on lines 3..10

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

    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

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

        offer_redemptions: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            offer_id: {type: 'string', maxlength: 24, nullable: false, references: 'offers.id', cascadeDelete: true},
            member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true},
            subscription_id: {type: 'string', maxlength: 24, nullable: false, references: 'members_stripe_customers_subscriptions.id', cascadeDelete: true},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 5 hrs to fix
    ghost/core/core/server/data/migrations/versions/4.20/04-add-offer-redemptions-table.js on lines 3..9

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

    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

        comment_likes: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            comment_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'comments.id', cascadeDelete: true},
            member_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'members.id', cascadeDelete: true},
            created_at: {type: 'dateTime', nullable: false},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 5 hrs to fix
    ghost/core/core/server/data/schema/schema.js on lines 965..971

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

    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

        comment_reports: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            comment_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'comments.id', cascadeDelete: true},
            member_id: {type: 'string', maxlength: 24, nullable: true, unique: false, references: 'members.id', setNullDelete: true},
            created_at: {type: 'dateTime', nullable: false},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 5 hrs to fix
    ghost/core/core/server/data/schema/schema.js on lines 958..964

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

    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 4 locations. Consider refactoring.
    Open

        members_labels: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true},
            label_id: {type: 'string', maxlength: 24, nullable: false, references: 'labels.id', cascadeDelete: true},
            sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 3 other locations - About 4 hrs to fix
    ghost/core/core/server/data/schema/schema.js on lines 504..509
    ghost/core/core/server/data/schema/schema.js on lines 517..522
    ghost/core/core/server/data/schema/schema.js on lines 1073..1078

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

    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 4 locations. Consider refactoring.
    Open

        posts_products: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id', cascadeDelete: true},
            product_id: {type: 'string', maxlength: 24, nullable: false, references: 'products.id', cascadeDelete: true},
            sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 3 other locations - About 4 hrs to fix
    ghost/core/core/server/data/schema/schema.js on lines 504..509
    ghost/core/core/server/data/schema/schema.js on lines 625..630
    ghost/core/core/server/data/schema/schema.js on lines 1073..1078

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

    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 4 locations. Consider refactoring.
    Open

        collections_posts: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            collection_id: {type: 'string', maxlength: 24, nullable: false, references: 'collections.id', cascadeDelete: true},
            post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id', cascadeDelete: true},
            sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 3 other locations - About 4 hrs to fix
    ghost/core/core/server/data/schema/schema.js on lines 504..509
    ghost/core/core/server/data/schema/schema.js on lines 517..522
    ghost/core/core/server/data/schema/schema.js on lines 625..630

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

    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 4 locations. Consider refactoring.
    Open

        products_benefits: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            product_id: {type: 'string', maxlength: 24, nullable: false, references: 'products.id', cascadeDelete: true},
            benefit_id: {type: 'string', maxlength: 24, nullable: false, references: 'benefits.id', cascadeDelete: true},
            sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 3 other locations - About 4 hrs to fix
    ghost/core/core/server/data/schema/schema.js on lines 517..522
    ghost/core/core/server/data/schema/schema.js on lines 625..630
    ghost/core/core/server/data/schema/schema.js on lines 1073..1078

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

    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

        recommendation_subscribe_events: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            recommendation_id: {type: 'string', maxlength: 24, nullable: false, references: 'recommendations.id', unique: false, cascadeDelete: true},
            member_id: {type: 'string', maxlength: 24, nullable: true, references: 'members.id', unique: false, setNullDelete: true},
            created_at: {type: 'dateTime', nullable: false}
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 4 hrs to fix
    ghost/core/core/server/data/schema/schema.js on lines 1091..1096

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

    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

        recommendation_click_events: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            recommendation_id: {type: 'string', maxlength: 24, nullable: false, references: 'recommendations.id', unique: false, cascadeDelete: true},
            member_id: {type: 'string', maxlength: 24, nullable: true, references: 'members.id', unique: false, setNullDelete: true},
            created_at: {type: 'dateTime', nullable: false}
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 4 hrs to fix
    ghost/core/core/server/data/schema/schema.js on lines 1097..1102

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

    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

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

        milestones: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            type: {type: 'string', maxlength: 24, nullable: false},
            value: {type: 'integer', nullable: false},
            currency: {type: 'string', maxlength: 24, nullable: true},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 4 hrs to fix
    ghost/core/core/server/data/migrations/versions/5.36/2023-02-20-12-22-add-milestones-table.js on lines 3..10

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

    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

        mobiledoc_revisions: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            post_id: {type: 'string', maxlength: 24, nullable: false, index: true},
            mobiledoc: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
            created_at_ts: {type: 'bigInteger', nullable: false},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 3 hrs to fix
    ghost/core/core/server/data/migrations/versions/5.15/2022-09-16-08-22-add-post-revisions-table.js on lines 3..9

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

    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

        posts_authors: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id'},
            author_id: {type: 'string', maxlength: 24, nullable: false, references: 'users.id'},
            sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 3 hrs to fix
    ghost/core/core/server/data/schema/schema.js on lines 293..298

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

    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

        posts_tags: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id'},
            tag_id: {type: 'string', maxlength: 24, nullable: false, references: 'tags.id'},
            sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 3 hrs to fix
    ghost/core/core/server/data/schema/schema.js on lines 174..179

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

    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

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

        benefits: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            name: {type: 'string', maxlength: 191, nullable: false},
            slug: {type: 'string', maxlength: 191, nullable: false, unique: true},
            created_at: {type: 'dateTime', nullable: false},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 3 hrs to fix
    ghost/core/core/server/data/migrations/versions/4.9/02-add-benefits-table.js on lines 3..9

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

    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

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

        temp_mail_events: {
            id: {type: 'string', maxlength: 100, nullable: false, primary: true},
            type: {type: 'string', maxlength: 50, nullable: false},
            message_id: {type: 'string', maxlength: 150, nullable: false},
            recipient: {type: 'string', maxlength: 191, nullable: false},
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 3 hrs to fix
    ghost/core/core/server/data/migrations/versions/5.53/2023-06-13-12-24-add-temp-mail-events-table.js on lines 3..9

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

    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

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

        members_cancel_events: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true},
            from_plan: {type: 'string', maxlength: 255, nullable: false},
            created_at: {type: 'dateTime', nullable: false}
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 3 hrs to fix
    ghost/core/core/server/data/migrations/versions/4.40/2022-03-07-14-37-add-members-cancel-events-table.js on lines 3..8

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

    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

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

        members_login_events: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true},
            created_at: {type: 'dateTime', nullable: false}
        },
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 1 other location - About 2 hrs to fix
    ghost/core/core/server/data/migrations/versions/4.0/08-add-members-login-events-table.js on lines 3..7

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

    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 3 locations. Consider refactoring.
    Open

        roles_users: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            role_id: {type: 'string', maxlength: 24, nullable: false},
            user_id: {type: 'string', maxlength: 24, nullable: false}
        },
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 2 other locations - About 1 hr to fix
    ghost/core/core/server/data/schema/schema.js on lines 205..209
    ghost/core/core/server/data/schema/schema.js on lines 210..214

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

    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 3 locations. Consider refactoring.
    Open

        permissions_users: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            user_id: {type: 'string', maxlength: 24, nullable: false},
            permission_id: {type: 'string', maxlength: 24, nullable: false}
        },
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 2 other locations - About 1 hr to fix
    ghost/core/core/server/data/schema/schema.js on lines 189..193
    ghost/core/core/server/data/schema/schema.js on lines 210..214

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

    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 3 locations. Consider refactoring.
    Open

        permissions_roles: {
            id: {type: 'string', maxlength: 24, nullable: false, primary: true},
            role_id: {type: 'string', maxlength: 24, nullable: false},
            permission_id: {type: 'string', maxlength: 24, nullable: false}
        },
    Severity: Major
    Found in ghost/core/core/server/data/schema/schema.js and 2 other locations - About 1 hr to fix
    ghost/core/core/server/data/schema/schema.js on lines 189..193
    ghost/core/core/server/data/schema/schema.js on lines 205..209

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

    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