nephila/djangocms-blog

View on GitHub
djangocms_blog/cms_appconfig.py

Summary

Maintainability
B
6 hrs
Test Coverage

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

    default_image_thumbnail = forms.ModelChoiceField(
        label=_("Default size of thumbnail images"),
        queryset=ThumbnailOption.objects.all(),
        required=False,
        help_text=_("If left empty the thumbnail image size will have to be set for every newly created post."),
Severity: Minor
Found in djangocms_blog/cms_appconfig.py and 1 other location - About 50 mins to fix
djangocms_blog/cms_appconfig.py on lines 57..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 36.

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

    default_image_full = forms.ModelChoiceField(
        label=_("Default size of full images"),
        queryset=ThumbnailOption.objects.all(),
        required=False,
        help_text=_("If left empty the image size will have to be set for every newly created post."),
Severity: Minor
Found in djangocms_blog/cms_appconfig.py and 1 other location - About 50 mins to fix
djangocms_blog/cms_appconfig.py on lines 64..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 36.

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

    twitter_type = forms.ChoiceField(
        label=_("Twitter type"),
        required=False,
        choices=get_setting("TWITTER_TYPES"),
        initial=get_setting("TWITTER_TYPE"),
Severity: Major
Found in djangocms_blog/cms_appconfig.py and 6 other locations - About 40 mins to fix
djangocms_blog/cms_appconfig.py on lines 90..94
djangocms_blog/cms_appconfig.py on lines 97..101
djangocms_blog/cms_appconfig.py on lines 135..139
djangocms_blog/cms_appconfig.py on lines 142..143
djangocms_blog/cms_appconfig.py on lines 146..147
djangocms_blog/cms_appconfig.py on lines 185..189

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

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

    paginate_by = forms.IntegerField(
        label=_("Paginate size"),
        required=False,
        initial=get_setting("PAGINATION"),
        help_text=_("When paginating list views, how many articles per page?"),
Severity: Major
Found in djangocms_blog/cms_appconfig.py and 6 other locations - About 40 mins to fix
djangocms_blog/cms_appconfig.py on lines 90..94
djangocms_blog/cms_appconfig.py on lines 135..139
djangocms_blog/cms_appconfig.py on lines 142..143
djangocms_blog/cms_appconfig.py on lines 146..147
djangocms_blog/cms_appconfig.py on lines 170..174
djangocms_blog/cms_appconfig.py on lines 185..189

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

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

    sitemap_priority = forms.CharField(
        label=_("Sitemap priority"),
        required=True,
        initial=get_setting("SITEMAP_PRIORITY_DEFAULT"),
        help_text=_("Priority attribute for sitemap items"),
Severity: Major
Found in djangocms_blog/cms_appconfig.py and 6 other locations - About 40 mins to fix
djangocms_blog/cms_appconfig.py on lines 90..94
djangocms_blog/cms_appconfig.py on lines 97..101
djangocms_blog/cms_appconfig.py on lines 142..143
djangocms_blog/cms_appconfig.py on lines 146..147
djangocms_blog/cms_appconfig.py on lines 170..174
djangocms_blog/cms_appconfig.py on lines 185..189

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

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

    gplus_type = forms.ChoiceField(
        label=_("Schema.org type"),
        required=False,
        choices=get_setting("SCHEMAORG_TYPES"),
        initial=get_setting("SCHEMAORG_TYPE"),
Severity: Major
Found in djangocms_blog/cms_appconfig.py and 6 other locations - About 40 mins to fix
djangocms_blog/cms_appconfig.py on lines 90..94
djangocms_blog/cms_appconfig.py on lines 97..101
djangocms_blog/cms_appconfig.py on lines 135..139
djangocms_blog/cms_appconfig.py on lines 142..143
djangocms_blog/cms_appconfig.py on lines 146..147
djangocms_blog/cms_appconfig.py on lines 170..174

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

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

    set_author = forms.BooleanField(
        label=_("Set author"),
        required=False,
        help_text=_("Set author by default"),
        initial=get_setting("AUTHOR_DEFAULT"),
Severity: Major
Found in djangocms_blog/cms_appconfig.py and 6 other locations - About 40 mins to fix
djangocms_blog/cms_appconfig.py on lines 97..101
djangocms_blog/cms_appconfig.py on lines 135..139
djangocms_blog/cms_appconfig.py on lines 142..143
djangocms_blog/cms_appconfig.py on lines 146..147
djangocms_blog/cms_appconfig.py on lines 170..174
djangocms_blog/cms_appconfig.py on lines 185..189

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

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

    og_type = forms.ChoiceField(
        label=_("Facebook type"), required=False, choices=get_setting("FB_TYPES"), initial=get_setting("FB_TYPE")
Severity: Major
Found in djangocms_blog/cms_appconfig.py and 6 other locations - About 40 mins to fix
djangocms_blog/cms_appconfig.py on lines 90..94
djangocms_blog/cms_appconfig.py on lines 97..101
djangocms_blog/cms_appconfig.py on lines 135..139
djangocms_blog/cms_appconfig.py on lines 142..143
djangocms_blog/cms_appconfig.py on lines 170..174
djangocms_blog/cms_appconfig.py on lines 185..189

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

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

    object_type = forms.ChoiceField(
        label=_("Object type"), required=False, choices=get_setting("TYPES"), initial=get_setting("TYPE")
Severity: Major
Found in djangocms_blog/cms_appconfig.py and 6 other locations - About 40 mins to fix
djangocms_blog/cms_appconfig.py on lines 90..94
djangocms_blog/cms_appconfig.py on lines 97..101
djangocms_blog/cms_appconfig.py on lines 135..139
djangocms_blog/cms_appconfig.py on lines 146..147
djangocms_blog/cms_appconfig.py on lines 170..174
djangocms_blog/cms_appconfig.py on lines 185..189

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

There are no issues that match your filters.

Category
Status