dbmedialab/reader-critics

View on GitHub

Showing 64 of 66 total issues

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

    getFeedbackText() {
        const {feedback} = this.props;
        let originalText = feedback.text;
        const originalItem = feedback.article.items.find(
            i => i.order.type === feedback.order.type && i.order.item === feedback.order.item
Severity: Major
Found in src/admin/components/feedbacks/FeedbackItemComponent.tsx and 1 other location - About 6 hrs to fix
src/admin/components/article/ArticleFeedbackItemComponent.tsx on lines 48..62

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

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

    getFeedbackText() {
        const {feedback} = this.props;
        let originalText = feedback.text;
        const originalItem = feedback.article.items.find(
            i => i.order.type === feedback.order.type && i.order.item === feedback.order.item
src/admin/components/feedbacks/FeedbackItemComponent.tsx on lines 43..57

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

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

module.exports = createPersistingService <ArticleDocument, ArticleService, Article> (
    ArticleModel, {
        addFeedback,
        download,
        exists,
Severity: Major
Found in src/app/services/article/ArticleService.live.ts and 1 other location - About 3 hrs to fix
src/app/services/article/ArticleService.mock.ts on lines 49..67

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

module.exports = createPersistingService <ArticleDocument, ArticleService, Article> (
    ArticleModel, {
        addFeedback,
        download,
        exists,
Severity: Major
Found in src/app/services/article/ArticleService.mock.ts and 1 other location - About 3 hrs to fix
src/app/services/article/ArticleService.live.ts on lines 49..67

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

                {feedbackLinks.length?
                <div className="row expanded links-section">
                    <div className="small-12">
                        <div className="item-label">Links</div>
                    </div>
Severity: Major
Found in src/admin/components/feedbacks/FeedbackItemComponent.tsx and 1 other location - About 3 hrs to fix
src/admin/components/article/ArticleFeedbackItemComponent.tsx on lines 95..106

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

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

                {feedbackLinks.length?
                <div className="row expanded links-section">
                    <div className="small-12">
                        <div className="item-label">Links</div>
                    </div>
src/admin/components/feedbacks/FeedbackItemComponent.tsx on lines 95..106

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

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

Function render has 99 lines of code (exceeds 40 allowed). Consider refactoring.
Open

    render(): JSX.Element {
        const roles = this.makeRolesOptions();
        const isDisabled = this.isFormValid();
        return (
            <ReactModal isOpen={this.props.isOpen} name="newUser" closeHandler={this.closePopup}>
Severity: Major
Found in src/admin/components/modal/AddUserModalComponent.tsx - About 3 hrs to fix

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

                            {this.props.mainPreloader.isVisible?
                                <div className="preloader-section">
                                        <PreloaderIcon
                                                type={ICON_TYPE.OVAL}
                                                size={50}
    Severity: Major
    Found in src/admin/components/layout/LayoutComponent.tsx and 1 other location - About 3 hrs to fix
    src/admin/components/layout/LoginLayoutComponent.tsx on lines 34..44

    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

                            {this.props.mainPreloader.isVisible?
                                <div className="preloader-section">
                                        <PreloaderIcon
                                                type={ICON_TYPE.OVAL}
                                                size={50}
    Severity: Major
    Found in src/admin/components/layout/LoginLayoutComponent.tsx and 1 other location - About 3 hrs to fix
    src/admin/components/layout/LayoutComponent.tsx on lines 51..61

    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

    const service : FeedbackService
        = createPersistingService <FeedbackDocument, FeedbackService,    Feedback> (
            FeedbackModel, {
                getAmountByArticle,
                getByArticle,
    Severity: Major
    Found in src/app/services/feedback/FeedbackService.mock.ts and 1 other location - About 2 hrs to fix
    src/app/services/feedback/FeedbackService.live.ts on lines 52..68

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

    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

                    {feedback.comment?
                    <div className="row expanded comment-section">
                        <div className="small-12">
                            <div className="item-label">User comment</div>
                        </div>
    Severity: Major
    Found in src/admin/components/feedbacks/FeedbackItemComponent.tsx and 1 other location - About 2 hrs to fix
    src/admin/components/article/ArticleFeedbackItemComponent.tsx on lines 85..94

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

    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

    const service : FeedbackService
        = createPersistingService <FeedbackDocument, FeedbackService,    Feedback> (
            FeedbackModel, {
                getAmountByArticle,
                getByArticle,
    Severity: Major
    Found in src/app/services/feedback/FeedbackService.live.ts and 1 other location - About 2 hrs to fix
    src/app/services/feedback/FeedbackService.mock.ts on lines 52..68

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

    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

                    {feedback.comment?
                    <div className="row expanded comment-section">
                        <div className="small-12">
                            <div className="item-label">User comment</div>
                        </div>
    src/admin/components/feedbacks/FeedbackItemComponent.tsx on lines 85..94

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

    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

        protected parseTitleFromMetaData() : Promise <string> {
            const meta = this.select('meta[name="title"]').toArray();
    
            if (meta.length === 1) {
                return Promise.resolve(this.select(meta[0]).attr('content'));
    Severity: Major
    Found in src/app/parser/AbstractIteratingParser.ts and 1 other location - About 2 hrs to fix
    src/app/parser/impl/generic/GenericParser.ts on lines 78..86

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

    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

        protected parseTitleFromMetaData() : Promise <string> {
            const meta = this.select('meta[name="title"]').toArray();
    
            if (meta.length === 1) {
                return Promise.resolve(this.select(meta[0]).attr('content'));
    Severity: Major
    Found in src/app/parser/impl/generic/GenericParser.ts and 1 other location - About 2 hrs to fix
    src/app/parser/AbstractIteratingParser.ts on lines 143..151

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

    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

        getCurrentInput(propName) {
            const options: OptionsI = {};
            options.input = {};
            options.input[propName] = this.props[propName];
            options.input[propName].touched = true;
    Severity: Major
    Found in src/admin/components/modal/LoginModalComponent.tsx and 1 other location - About 2 hrs to fix
    src/admin/components/modal/AddUserModalComponent.tsx on lines 57..64

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

    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

        getCurrentInput(propName) {
            const options : OptionsI = {};
            options.input = {};
            options.input[propName] = this.props[propName];
            options.input[propName].touched = true;
    Severity: Major
    Found in src/admin/components/modal/AddUserModalComponent.tsx and 1 other location - About 2 hrs to fix
    src/admin/components/modal/LoginModalComponent.tsx on lines 61..67

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

    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

    Function default has 65 lines of code (exceeds 40 allowed). Consider refactoring.
    Open

    export default function(skip: number = defaultSkip,
                            limit: number = defaultLimit,
                            sort: Object = defaultSort,
                            search?: string
    ): Promise <ArticleDocument[]> {
    Severity: Major
    Found in src/app/services/article/common/getRangeWithFBCount.ts - About 2 hrs to fix

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

          render (): JSX.Element {
              const {isOpen, name, ID, feedbackPage, feedbackNotificationMail} = this.props;
              const isDisabled = name && !ID;
      
              const captionAdd = (<div className="caption" key="add-website"><b>Add New Website</b></div>);
      Severity: Major
      Found in src/admin/components/modal/WebsiteModalComponent.tsx - About 2 hrs to fix

        Function render has 63 lines of code (exceeds 40 allowed). Consider refactoring.
        Open

            render(){
                const {
                    comment,
                    email,
                    date: {
        Severity: Major
        Found in src/admin/components/suggestions/SuggestionsListItemComponent.tsx - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language