Showing 181 of 181 total issues
Function checkTemplates
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function checkTemplates($path = null)
{
if (defined('PHAR_SWG2MD_ROOT_PATH')) {
$baseDir = PHAR_SWG2MD_ROOT_PATH;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getSummary
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getSummary(\SwaggerValidator\Common\Context $context)
{
$method = __FUNCTION__;
$summary = array();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function renderTable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function renderTable($name, $anchor, $listKey, $colonsFile, $template, $vars, $store = null)
{
if ($store !== false) {
$file = $this->checkAndMakeObjectFolder();
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function markdown
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context, $generalItems)
{
$method = __FUNCTION__;
$generalItems = $this->getMethodGeneric($context, $method, $generalItems);
$tplResources = array();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this method. Open
return;
Missing class import via use statement (line '53', column '121'). Open
\SwaggerValidator\Common\Factory::getInstance()->set(\SwaggerValidator\Common\CollectionType::ResponseItem, new \Swagger2md\SwaggerValidator\Object\ResponseItem());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '229', column '71'). Open
file_put_contents($this->output, $this->swagger->markdown(new \Swagger2md\Context()));
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '38', column '123'). Open
\SwaggerValidator\Common\Factory::getInstance()->set(\SwaggerValidator\Common\CollectionType::TypeArrayItems, new \Swagger2md\SwaggerValidator\DataType\TypeArrayItems());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '36', column '120'). Open
\SwaggerValidator\Common\Factory::getInstance()->set(\SwaggerValidator\Common\CollectionType::TypeInteger, new \Swagger2md\SwaggerValidator\DataType\TypeInteger());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '37', column '118'). Open
\SwaggerValidator\Common\Factory::getInstance()->set(\SwaggerValidator\Common\CollectionType::TypeArray, new \Swagger2md\SwaggerValidator\DataType\TypeArray());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '60', column '116'). Open
\SwaggerValidator\Common\Factory::getInstance()->set(\SwaggerValidator\Common\CollectionType::Contact, new \Swagger2md\SwaggerValidator\Object\Contact());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '42', column '119'). Open
\SwaggerValidator\Common\Factory::getInstance()->set(\SwaggerValidator\Common\CollectionType::TypeNumber, new \Swagger2md\SwaggerValidator\DataType\TypeNumber());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '43', column '117'). Open
\SwaggerValidator\Common\Factory::getInstance()->set(\SwaggerValidator\Common\CollectionType::TypeFile, new \Swagger2md\SwaggerValidator\DataType\TypeFile());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '49', column '122'). Open
\SwaggerValidator\Common\Factory::getInstance()->set(\SwaggerValidator\Common\CollectionType::ParameterBody, new \Swagger2md\SwaggerValidator\Object\ParameterBody());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '195', column '62'). Open
$this->swagger = \SwaggerValidator\Swagger::load(new \Swagger2md\Context());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '46', column '119'). Open
\SwaggerValidator\Common\Factory::getInstance()->set(\SwaggerValidator\Common\CollectionType::Parameters, new \Swagger2md\SwaggerValidator\Object\Parameters());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '50', column '116'). Open
\SwaggerValidator\Common\Factory::getInstance()->set(\SwaggerValidator\Common\CollectionType::Swagger, new \Swagger2md\SwaggerValidator\Object\Swagger());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid too many return
statements within this method. Open
return $this->twigTpl->render($template, $vars);
Missing class import via use statement (line '170', column '34'). Open
$this->twigTpl = new \Twig_Environment(new \Twig_Loader_Filesystem($this->templateFolder), array(
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '40', column '119'). Open
\SwaggerValidator\Common\Factory::getInstance()->set(\SwaggerValidator\Common\CollectionType::TypeObject, new \Swagger2md\SwaggerValidator\DataType\TypeObject());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}