aldryn/aldryn-faq

View on GitHub

Showing 25 of 39 total issues

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

        migrations.CreateModel(
            name='TopQuestionsPlugin',
            fields=[
                ('cmsplugin_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin')),
                ('questions', models.IntegerField(default=5, help_text='The number of questions to be displayed.')),
Severity: Major
Found in aldryn_faq/migrations/0001_initial.py and 2 other locations - About 3 hrs to fix
aldryn_faq/migrations/0001_initial.py on lines 88..97
aldryn_faq/migrations/0001_initial.py on lines 99..108

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

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

        migrations.CreateModel(
            name='MostReadQuestionsPlugin',
            fields=[
                ('cmsplugin_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin')),
                ('questions', models.IntegerField(default=5, help_text='The number of questions to be displayed.')),
Severity: Major
Found in aldryn_faq/migrations/0001_initial.py and 2 other locations - About 3 hrs to fix
aldryn_faq/migrations/0001_initial.py on lines 88..97
aldryn_faq/migrations/0001_initial.py on lines 171..180

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

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

        migrations.CreateModel(
            name='LatestQuestionsPlugin',
            fields=[
                ('cmsplugin_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin')),
                ('questions', models.IntegerField(default=5, help_text='The number of questions to be displayed.')),
Severity: Major
Found in aldryn_faq/migrations/0001_initial.py and 2 other locations - About 3 hrs to fix
aldryn_faq/migrations/0001_initial.py on lines 99..108
aldryn_faq/migrations/0001_initial.py on lines 171..180

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

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

            if change_category_perm and category:
                url_args = {}
                if language:
                    url_args = {'language': language, }
                url = get_admin_url('aldryn_faq_category_change',
Severity: Major
Found in aldryn_faq/cms_toolbars.py and 1 other location - About 3 hrs to fix
aldryn_faq/cms_toolbars.py on lines 212..218

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

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

            if change_question_perm and question:
                url_args = {}
                if language:
                    url_args = {'language': language, }
                url = get_admin_url('aldryn_faq_question_change',
Severity: Major
Found in aldryn_faq/cms_toolbars.py and 1 other location - About 3 hrs to fix
aldryn_faq/cms_toolbars.py on lines 181..187

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

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

            if delete_question_perm and question:
                redirect_url = self.get_on_delete_redirect_url(
                    question, language)
                url = get_admin_url('aldryn_faq_question_delete',
                                    [question.pk, ])
Severity: Major
Found in aldryn_faq/cms_toolbars.py and 1 other location - About 2 hrs to fix
aldryn_faq/cms_toolbars.py on lines 190..195

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

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

            if delete_category_perm and category:
                redirect_url = self.get_on_delete_redirect_url(
                    category, language)
                url = get_admin_url('aldryn_faq_category_delete',
                                    [category.pk, ])
Severity: Major
Found in aldryn_faq/cms_toolbars.py and 1 other location - About 2 hrs to fix
aldryn_faq/cms_toolbars.py on lines 221..226

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

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

    def __str__(self):
        pkstr = str(self.pk)
        if six.PY2:
            pkstr = six.u(pkstr)
        return self.safe_translation_getter('title', default=pkstr)
Severity: Major
Found in aldryn_faq/models.py and 1 other location - About 1 hr to fix
aldryn_faq/models.py on lines 100..104

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

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

    def __str__(self):
        pkstr = str(self.pk)
        if six.PY2:
            pkstr = six.u(pkstr)
        return self.safe_translation_getter('name', default=pkstr)
Severity: Major
Found in aldryn_faq/models.py and 1 other location - About 1 hr to fix
aldryn_faq/models.py on lines 179..183

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

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

        migrations.AddField(
            model_name='faqconfig',
            name='placeholder_faq_sidebar_top',
            field=cms.models.fields.PlaceholderField(related_name='aldryn_faq_sidebar_top', slotname='faq_sidebar_top', editable=False, to='cms.Placeholder', null=True),
Severity: Major
Found in aldryn_faq/migrations/0004_auto_20150626_1205.py and 4 other locations - About 1 hr to fix
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 16..19
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 22..25
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 28..31
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 34..37

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

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

        migrations.AddField(
            model_name='faqconfig',
            name='placeholder_faq_content',
            field=cms.models.fields.PlaceholderField(related_name='aldryn_faq_content', slotname='faq_content', editable=False, to='cms.Placeholder', null=True),
Severity: Major
Found in aldryn_faq/migrations/0004_auto_20150626_1205.py and 4 other locations - About 1 hr to fix
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 22..25
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 28..31
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 34..37
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 40..43

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

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

        migrations.AddField(
            model_name='faqconfig',
            name='placeholder_faq_sidebar_bottom',
            field=cms.models.fields.PlaceholderField(related_name='aldryn_faq_sidebar_bottom', slotname='faq_sidebar_bottom', editable=False, to='cms.Placeholder', null=True),
Severity: Major
Found in aldryn_faq/migrations/0004_auto_20150626_1205.py and 4 other locations - About 1 hr to fix
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 16..19
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 22..25
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 28..31
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 40..43

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

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

        migrations.AddField(
            model_name='faqconfig',
            name='placeholder_faq_list_top',
            field=cms.models.fields.PlaceholderField(related_name='aldryn_faq_list_top', slotname='faq_list_top', editable=False, to='cms.Placeholder', null=True),
Severity: Major
Found in aldryn_faq/migrations/0004_auto_20150626_1205.py and 4 other locations - About 1 hr to fix
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 16..19
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 22..25
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 34..37
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 40..43

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

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

        migrations.AddField(
            model_name='faqconfig',
            name='placeholder_faq_list_bottom',
            field=cms.models.fields.PlaceholderField(related_name='aldryn_faq_list_bottom', slotname='faq_list_bottom', editable=False, to='cms.Placeholder', null=True),
Severity: Major
Found in aldryn_faq/migrations/0004_auto_20150626_1205.py and 4 other locations - About 1 hr to fix
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 16..19
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 28..31
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 34..37
aldryn_faq/migrations/0004_auto_20150626_1205.py on lines 40..43

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

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

        migrations.AlterField(
            model_name='categorylistplugin',
            name='cmsplugin_ptr',
            field=models.OneToOneField(parent_link=True, related_name='aldryn_faq_categorylistplugin', primary_key=True, serialize=False, to='cms.CMSPlugin'),
Severity: Major
Found in aldryn_faq/migrations/0014_auto_20160821_1239.py and 4 other locations - About 45 mins to fix
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 19..22
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 24..27
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 29..32
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 34..37

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

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

        migrations.AlterField(
            model_name='latestquestionsplugin',
            name='cmsplugin_ptr',
            field=models.OneToOneField(parent_link=True, related_name='aldryn_faq_latestquestionsplugin', primary_key=True, serialize=False, to='cms.CMSPlugin'),
Severity: Major
Found in aldryn_faq/migrations/0014_auto_20160821_1239.py and 4 other locations - About 45 mins to fix
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 14..17
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 24..27
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 29..32
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 34..37

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

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

        migrations.AlterField(
            model_name='mostreadquestionsplugin',
            name='cmsplugin_ptr',
            field=models.OneToOneField(parent_link=True, related_name='aldryn_faq_mostreadquestionsplugin', primary_key=True, serialize=False, to='cms.CMSPlugin'),
Severity: Major
Found in aldryn_faq/migrations/0014_auto_20160821_1239.py and 4 other locations - About 45 mins to fix
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 14..17
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 19..22
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 29..32
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 34..37

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

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

        migrations.AlterField(
            model_name='topquestionsplugin',
            name='cmsplugin_ptr',
            field=models.OneToOneField(parent_link=True, related_name='aldryn_faq_topquestionsplugin', primary_key=True, serialize=False, to='cms.CMSPlugin'),
Severity: Major
Found in aldryn_faq/migrations/0014_auto_20160821_1239.py and 4 other locations - About 45 mins to fix
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 14..17
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 19..22
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 24..27
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 29..32

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

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

        migrations.AlterField(
            model_name='questionlistplugin',
            name='cmsplugin_ptr',
            field=models.OneToOneField(parent_link=True, related_name='aldryn_faq_questionlistplugin', primary_key=True, serialize=False, to='cms.CMSPlugin'),
Severity: Major
Found in aldryn_faq/migrations/0014_auto_20160821_1239.py and 4 other locations - About 45 mins to fix
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 14..17
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 19..22
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 24..27
aldryn_faq/migrations/0014_auto_20160821_1239.py on lines 34..37

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

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

class LatestQuestionsPlugin(QuestionsPlugin, AdjustableCacheModelMixin):

    def get_queryset(self):
        qs = super(LatestQuestionsPlugin, self).get_queryset()
        return qs.order_by('-id')
Severity: Minor
Found in aldryn_faq/models.py and 1 other location - About 40 mins to fix
aldryn_faq/models.py on lines 356..360

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

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

Severity
Category
Status
Source
Language