Showing 604 of 604 total issues
The class TypeCombined has an overall complexity of 64 which is very high. The configured complexity threshold is 50. Open
class TypeCombined extends \SwaggerValidator\Common\CollectionSwagger
{
public function __construct()
{
- Exclude checks
TypeCommon
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class TypeCommon extends \SwaggerValidator\Common\CollectionSwagger
{
abstract protected function type(\SwaggerValidator\Common\Context $context, $valueParams);
The class TypeCommon has 14 public methods. Consider refactoring TypeCommon to keep number of public methods under 10. Open
abstract class TypeCommon extends \SwaggerValidator\Common\CollectionSwagger
{
abstract protected function type(\SwaggerValidator\Common\Context $context, $valueParams);
- 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 TypeObject has an overall complexity of 65 which is very high. The configured complexity threshold is 50. Open
class TypeObject extends \SwaggerValidator\Common\CollectionSwagger
{
/**
*
- Exclude checks
The class Context has an overall complexity of 152 which is very high. The configured complexity threshold is 50. Open
class Context extends ContextBase implements \SwaggerValidator\Interfaces\ContextLog, \SwaggerValidator\Interfaces\ContextDataLoader, \SwaggerValidator\Interfaces\ContextDataParser
{
/*
* Mode Constants
*/
- Exclude checks
The class Context has 29 non-getter- and setter-methods. Consider refactoring Context to keep number of methods under 25. Open
class Context extends ContextBase implements \SwaggerValidator\Interfaces\ContextLog, \SwaggerValidator\Interfaces\ContextDataLoader, \SwaggerValidator\Interfaces\ContextDataParser
{
/*
* Mode Constants
*/
- Read upRead up
- 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 TypeCommon has an overall complexity of 77 which is very high. The configured complexity threshold is 50. Open
abstract class TypeCommon extends \SwaggerValidator\Common\CollectionSwagger
{
abstract protected function type(\SwaggerValidator\Common\Context $context, $valueParams);
- Exclude checks
The class CollectionReference has an overall complexity of 56 which is very high. The configured complexity threshold is 50. Open
class CollectionReference extends \SwaggerValidator\Common\Collection
{
const ID_PREFIX = 'id:';
- Exclude checks
The class CollectionSwagger has an overall complexity of 63 which is very high. The configured complexity threshold is 50. Open
class CollectionSwagger extends \SwaggerValidator\Common\Collection
{
/**
*
- Exclude checks
The class ContextBase has an overall complexity of 102 which is very high. The configured complexity threshold is 50. Open
class ContextBase implements \SwaggerValidator\Interfaces\ContextBase
{
/**
*
- Exclude checks
The class ContextBase has 12 public methods. Consider refactoring ContextBase to keep number of public methods under 10. Open
class ContextBase implements \SwaggerValidator\Interfaces\ContextBase
{
/**
*
- 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 TypeArray has an overall complexity of 51 which is very high. The configured complexity threshold is 50. Open
class TypeArray extends \SwaggerValidator\DataType\TypeCommon
{
public function __construct()
{
- Exclude checks
The class TypeString has an overall complexity of 58 which is very high. The configured complexity threshold is 50. Open
class TypeString extends \SwaggerValidator\DataType\TypeCommon
{
const PATTERN_BYTE = '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$';
//const PATTERN_BINARY = '^(?:([A-Fa-f0-9]{2})*|([01]{4}[ ]?)*)?$'; // Allow Hexa form
- Exclude checks
The class TypeArrayItems has an overall complexity of 67 which is very high. The configured complexity threshold is 50. Open
class TypeArrayItems extends \SwaggerValidator\DataType\TypeCommon
{
protected $minItems = 1;
protected $maxItems = null;
- Exclude checks
The class Context has 25 public methods. Consider refactoring Context to keep number of public methods under 10. Open
class Context extends ContextBase implements \SwaggerValidator\Interfaces\ContextLog, \SwaggerValidator\Interfaces\ContextDataLoader, \SwaggerValidator\Interfaces\ContextDataParser
{
/*
* Mode Constants
*/
- 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 ReferenceFile has an overall complexity of 59 which is very high. The configured complexity threshold is 50. Open
class ReferenceFile
{
const PATH_TYPE_URL = 1;
const PATH_TYPE_FILE = 2;
- Exclude checks
The class Collection has 19 public methods. Consider refactoring Collection to keep number of public methods under 10. Open
class Collection implements \Countable, \IteratorAggregate, \ArrayAccess, \Serializable, \JsonSerializable
{
/**
*
- 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 CollectionReference has 13 public methods. Consider refactoring CollectionReference to keep number of public methods under 10. Open
class CollectionReference extends \SwaggerValidator\Common\Collection
{
const ID_PREFIX = 'id:';
- 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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($key === \SwaggerValidator\Common\FactorySwagger::KEY_REFERENCE) {
$oldRef = $value;
$value = \SwaggerValidator\Common\CollectionReference::getIdFromRef($context, $value);
$context->logReference('replace', $value, $oldRef, __METHOD__, __LINE__);
$refList[] = $value;
- 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 144.
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
if ($key === \SwaggerValidator\Common\FactorySwagger::KEY_REFERENCE) {
$oldRef = $value;
$value = \SwaggerValidator\Common\CollectionReference::getIdFromRef($context, $value);
$context->logReference('replace', $value, $oldRef, __METHOD__, __LINE__);
$refList[] = $value;
- 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 144.
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