Showing 4,293 of 4,293 total issues
The class Field has an overall complexity of 80 which is very high. The configured complexity threshold is 50. Open
abstract class Field implements ExportableFieldInterface
{
/**
* Unique id generated on run time
- Exclude checks
The class ImageObjectDeprecated has 11 public methods. Consider refactoring ImageObjectDeprecated to keep number of public methods under 10. Open
class ImageObjectDeprecated
{
public $attachment;
- Read upRead up
- Exclude checks
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 Field has 15 public methods. Consider refactoring Field to keep number of public methods under 10. Open
abstract class Field implements ExportableFieldInterface
{
/**
* Unique id generated on run time
- Read upRead up
- Exclude checks
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 StandardFieldSection has 11 public methods. Consider refactoring StandardFieldSection to keep number of public methods under 10. Open
class StandardFieldSection implements ExportableFieldInterface
{
/**
* Preset defaults
- Read upRead up
- Exclude checks
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 StandardFieldSection has an overall complexity of 83 which is very high. The configured complexity threshold is 50. Open
class StandardFieldSection implements ExportableFieldInterface
{
/**
* Preset defaults
- Exclude checks
The class ImageResize has an overall complexity of 55 which is very high. The configured complexity threshold is 50. Open
class ImageResize
{
/**
* The singleton instance
*/
- Exclude checks
The class StandardFieldController has 14 public methods. Consider refactoring StandardFieldController to keep number of public methods under 10. Open
class StandardFieldController
{
/**
* Collection of added Sections / Fields ...
- Read upRead up
- Exclude checks
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 JSONTransport has 13 public methods. Consider refactoring JSONTransport to keep number of public methods under 10. Open
class JSONTransport
{
protected $data = array();
protected $publicData = array();
- Read upRead up
- Exclude checks
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 Utilities has an overall complexity of 104 which is very high. The configured complexity threshold is 50. Open
class Utilities
{
protected static $postEnvironments = array();
protected static $termEnvironments = array();
- Exclude checks
The class Module has an overall complexity of 65 which is very high. The configured complexity threshold is 50. Open
abstract class Module implements EntityInterface, FieldEntityInterface
{
/**
* Module Properties Object
- Exclude checks
The class Enqueues has an overall complexity of 56 which is very high. The configured complexity threshold is 50. Open
class Enqueues
{
protected static $styles;
protected static $adminScripts = array();
- Exclude checks
The class PostPanel has 12 public methods. Consider refactoring PostPanel to keep number of public methods under 10. Open
abstract class PostPanel extends AbstractPanel implements FormInterface
{
/**
* @var int
- Read upRead up
- Exclude checks
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 Utilities has 15 public methods. Consider refactoring Utilities to keep number of public methods under 10. Open
class Utilities
{
protected static $postEnvironments = array();
protected static $termEnvironments = array();
- Read upRead up
- Exclude checks
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 Module has 13 public methods. Consider refactoring Module to keep number of public methods under 10. Open
abstract class Module implements EntityInterface, FieldEntityInterface
{
/**
* Module Properties Object
- Read upRead up
- Exclude checks
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 OptionPanel has 12 public methods. Consider refactoring OptionPanel to keep number of public methods under 10. Open
abstract class OptionPanel extends AbstractPanel
{
/**
* @var SerOptionsDataProvider
- Read upRead up
- Exclude checks
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
prepareViews: function (views) {
return _.map(views, function (view) {
view.selected = (view.filename === this.moduleModel.get('viewfile')) ? 'selected="selected"' : '';
view.isActive = (view.filename === this.moduleModel.get('viewfile'));
return view;
- Read upRead up
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 101.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
prepareViews: function (views) {
return _.map(views, function (view) {
view.selected = (view.filename === this.model.get('viewfile')) ? 'selected="selected"' : '';
view.isActive = (view.filename === this.model.get('viewfile'));
return view;
- Read upRead up
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 101.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File kontentblocks.php
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
Plugin Name: Kontentblocks
Plugin URI: https://github.com/kai-jacobsen/kontentblocks
Description: Content modularization framework
Method registerScripts
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function registerScripts()
{
$folder = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? 'dev' : 'dist';
$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
$version = Kontentblocks::VERSION;
File UI.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
*
* These is a collection of helper functions to handle
* the user interface / user interaction such as
* - Sorting