Showing 1,792 of 1,794 total issues
The class App has an overall complexity of 196 which is very high. The configured complexity threshold is 50. Open
class App
{
use AppScopeTrait;
use DiContainerTrait;
use DynamicMethodTrait;
- Create a ticketCreate a ticket
- Exclude checks
The class Context has 53 non-getter- and setter-methods. Consider refactoring Context to keep number of methods under 25. Open
class Context extends RawMinkContext implements BehatContext
{
use JsCoverageContextTrait;
use RwDemosContextTrait;
use WarnDynamicPropertyTrait;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many 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'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class App has 26 public methods. Consider refactoring App to keep number of public methods under 10. Open
class App
{
use AppScopeTrait;
use DiContainerTrait;
use DynamicMethodTrait;
- Read upRead up
- Create a ticketCreate a ticket
- 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 Context has an overall complexity of 106 which is very high. The configured complexity threshold is 50. Open
class Context extends RawMinkContext implements BehatContext
{
use JsCoverageContextTrait;
use RwDemosContextTrait;
use WarnDynamicPropertyTrait;
- Create a ticketCreate a ticket
- Exclude checks
The class ScopeBuilder has an overall complexity of 71 which is very high. The configured complexity threshold is 50. Open
class ScopeBuilder extends Form\Control
{
public $renderLabel = false;
/** @var array<string, array<string, mixed>|bool> */
- Create a ticketCreate a ticket
- Exclude checks
The class Form has an overall complexity of 59 which is very high. The configured complexity threshold is 50. Open
class Form extends View
{
use HookTrait;
/** Executed when form is submitted */
- Create a ticketCreate a ticket
- Exclude checks
The class Grid has 22 public methods. Consider refactoring Grid to keep number of public methods under 10. Open
class Grid extends View
{
use HookTrait;
/** @var Menu|array<mixed>|false Will be initialized to Menu object, however you can set this to false to disable menu. */
- Read upRead up
- Create a ticketCreate a ticket
- 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 Grid has 27 non-getter- and setter-methods. Consider refactoring Grid to keep number of methods under 25. Open
class Grid extends View
{
use HookTrait;
/** @var Menu|array<mixed>|false Will be initialized to Menu object, however you can set this to false to disable menu. */
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many 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'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class Multiline has an overall complexity of 122 which is very high. The configured complexity threshold is 50. Open
class Multiline extends Form\Control
{
/** @var HtmlTemplate|null The template needed for the multiline view. */
public $multiLineTemplate;
- Create a ticketCreate a ticket
- Exclude checks
The class HtmlTemplate has an overall complexity of 82 which is very high. The configured complexity threshold is 50. Open
class HtmlTemplate
{
use WarnDynamicPropertyTrait;
public const TOP_TAG = '_top';
- Create a ticketCreate a ticket
- Exclude checks
The class Grid has an overall complexity of 79 which is very high. The configured complexity threshold is 50. Open
class Grid extends View
{
use HookTrait;
/** @var Menu|array<mixed>|false Will be initialized to Menu object, however you can set this to false to disable menu. */
- Create a ticketCreate a ticket
- Exclude checks
The class HtmlTemplate has 17 public methods. Consider refactoring HtmlTemplate to keep number of public methods under 10. Open
class HtmlTemplate
{
use WarnDynamicPropertyTrait;
public const TOP_TAG = '_top';
- Read upRead up
- Create a ticketCreate a ticket
- 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 Table has 11 public methods. Consider refactoring Table to keep number of public methods under 10. Open
class Table extends Lister
{
public $ui = 'table';
public $defaultTemplate = 'table.html';
- Read upRead up
- Create a ticketCreate a ticket
- 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 Ui has an overall complexity of 68 which is very high. The configured complexity threshold is 50. Open
class Ui extends Persistence
{
/** @var string */
public $locale = 'en';
- Create a ticketCreate a ticket
- Exclude checks
The class Table has an overall complexity of 87 which is very high. The configured complexity threshold is 50. Open
class Table extends Lister
{
public $ui = 'table';
public $defaultTemplate = 'table.html';
- Create a ticketCreate a ticket
- Exclude checks
The class View has 22 public methods. Consider refactoring View to keep number of public methods under 10. Open
class View extends AbstractView
{
/**
* When you call renderAll() this will be populated with JavaScript chains.
*
- Read upRead up
- Create a ticketCreate a ticket
- 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 View has an overall complexity of 152 which is very high. The configured complexity threshold is 50. Open
class View extends AbstractView
{
/**
* When you call renderAll() this will be populated with JavaScript chains.
*
- Create a ticketCreate a ticket
- Exclude checks
The class View has 27 non-getter- and setter-methods. Consider refactoring View to keep number of methods under 25. Open
class View extends AbstractView
{
/**
* When you call renderAll() this will be populated with JavaScript chains.
*
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many 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'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
Identical blocks of code found in 2 locations. Consider refactoring. Open
for (var i = 0; i < self.config.showMonths; i++) {
var d = new Date(self.currentYear, self.currentMonth, 1);
d.setMonth(self.currentMonth + i);
frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));
}
- Read upRead up
- Create a ticketCreate a ticket
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
for (var i = 0; i < self.config.showMonths; i++) {
var d = new Date(self.currentYear, self.currentMonth, 1);
d.setMonth(self.currentMonth + i);
frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));
}
- Read upRead up
- Create a ticketCreate a ticket
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