kai-jacobsen/kontentblocks

View on GitHub

Showing 4,293 of 4,293 total issues

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

  ready: function (frame) {
    var that = this;
    this.$('.media-modal').addClass(' smaller no-sidebar');
    var settings = that.model.get('settings');
    if (settings && settings.uploadFolder) {
Severity: Major
Found in js/src/fields/controls/file.js and 1 other location - About 3 hrs to fix
js/src/fieldsAPI/definitions/file-multiple.js on lines 75..82

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

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

  ready: function (frame) {
    var that = this;
    this.$('.media-modal').addClass(' smaller no-sidebar');
    var settings = that.model.get('settings');
    if (settings && settings.uploadFolder) {
Severity: Major
Found in js/src/fieldsAPI/definitions/file-multiple.js and 1 other location - About 3 hrs to fix
js/src/fields/controls/file.js on lines 51..58

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

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

File DynamicAreas.php has 313 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Kontentblocks\Backend\Dynamic;

use Kontentblocks\Areas\AreaProperties;
Severity: Minor
Found in core/Backend/Dynamic/DynamicAreas.php - About 3 hrs to fix

    StandardFieldSection has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class StandardFieldSection implements ExportableFieldInterface
    {
    
        /**
         * Preset defaults
    Severity: Minor
    Found in core/Fields/StandardFieldSection.php - About 3 hrs to fix

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

                    if (loc.bbox) {
                      latLngBounds = L.latLngBounds(
                        L.latLng(loc.bbox.slice(0, 2).reverse()),
                        L.latLng(loc.bbox.slice(2, 4).reverse())
                      );
      Severity: Major
      Found in js/third-party/leaflet.js and 1 other location - About 3 hrs to fix
      js/third-party/leaflet.js on lines 563..570

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

      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

                  if (loc.bbox) {
                    latLngBounds = L.latLngBounds(
                      L.latLng(loc.bbox.slice(0, 2).reverse()),
                      L.latLng(loc.bbox.slice(2, 4).reverse())
                    );
      Severity: Major
      Found in js/third-party/leaflet.js and 1 other location - About 3 hrs to fix
      js/third-party/leaflet.js on lines 616..623

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

      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

      File Module.php has 308 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace Kontentblocks\Modules;
      
      
      
      Severity: Minor
      Found in core/Modules/Module.php - About 3 hrs to fix

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

          resetImage: function () {
            this.$container.html('');
            this.$saveId.val('');
            this.model.set('value', {id: null, caption: '', title: ''});
            this.$description.val('');
        Severity: Major
        Found in js/src/fields/controls/image.js and 1 other location - About 3 hrs to fix
        js/src/fields/controls/cropimage.js on lines 191..197

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

        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

          resetImage: function () {
            this.$container.html('');
            this.$saveId.val('');
            this.model.set('value', {id: null, caption: '', title: ''});
            this.$description.val('');
        Severity: Major
        Found in js/src/fields/controls/cropimage.js and 1 other location - About 3 hrs to fix
        js/src/fields/controls/image.js on lines 205..211

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

        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

        The class AreaRegistry has an overall complexity of 71 which is very high. The configured complexity threshold is 50.
        Open

        class AreaRegistry
        {
        
            /**
             * All register areas
        Severity: Minor
        Found in core/Areas/AreaRegistry.php by phpmd

        The class Kontentblocks has 11 public methods. Consider refactoring Kontentblocks to keep number of public methods under 10.
        Open

        Class Kontentblocks
        {
        
            const VERSION = '0.12.3';
            const DEVMODE = true;
        Severity: Minor
        Found in kontentblocks.php by phpmd

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

        The class Kontentblocks has an overall complexity of 52 which is very high. The configured complexity threshold is 50.
        Open

        Class Kontentblocks
        {
        
            const VERSION = '0.12.3';
            const DEVMODE = true;
        Severity: Minor
        Found in kontentblocks.php by phpmd

        The class DynamicAreas has an overall complexity of 54 which is very high. The configured complexity threshold is 50.
        Open

        class DynamicAreas
        {
        
            /**
             * @var \Kontentblocks\Backend\Storage\ModuleStorage
        Severity: Minor
        Found in core/Backend/Dynamic/DynamicAreas.php by phpmd

        The class ValueObject has 12 public methods. Consider refactoring ValueObject to keep number of public methods under 10.
        Open

        class ValueObject implements ValueObjectInterface, \ArrayAccess, \JsonSerializable, \IteratorAggregate
        {
        
            /**
             * @var array
        Severity: Minor
        Found in core/Common/Data/ValueObject.php by phpmd

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

        The class EditableImage has 14 public methods. Consider refactoring EditableImage to keep number of public methods under 10.
        Open

        class EditableImage extends AbstractEditableFieldReturn implements \JsonSerializable
        {
            public $attachment;
        
        
        

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

        The class DynamicAreas has 11 public methods. Consider refactoring DynamicAreas to keep number of public methods under 10.
        Open

        class DynamicAreas
        {
        
            /**
             * @var \Kontentblocks\Backend\Storage\ModuleStorage
        Severity: Minor
        Found in core/Backend/Dynamic/DynamicAreas.php by phpmd

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

        The class ImageReturn has an overall complexity of 57 which is very high. The configured complexity threshold is 50.
        Open

        class ImageReturn extends StandardFieldReturn
        {
        
            /**
             * @var

        The class GlobalModulesMenu has an overall complexity of 52 which is very high. The configured complexity threshold is 50.
        Open

        class GlobalModulesMenu
        {
        
        
            /**

        The class ModuleStorage has 11 public methods. Consider refactoring ModuleStorage to keep number of public methods under 10.
        Open

        class ModuleStorage implements \Countable
        {
            /**
             * current post id
             * @var int

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

        The class ImageReturn has 14 public methods. Consider refactoring ImageReturn to keep number of public methods under 10.
        Open

        class ImageReturn extends StandardFieldReturn
        {
        
            /**
             * @var

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

        Severity
        Category
        Status
        Source
        Language