Showing 45 of 181 total issues
Function markdown
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context)
{
$method = __FUNCTION__;
$templateVars = array(
'partType' => \Swagger2md\Swagger2md::getInstance()->renderTemplate('PartTypeFormat', array('type' => \SwaggerValidator\Common\FactorySwagger::TYPE_OBJECT)),
- 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
File Swagger2md.php
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* Copyright 2016 Nicolas JUHEL<swaggervalidator@nabbar.com>.
*
Method loadSwaggerFile
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loadSwaggerFile($swaggerFile = null)
{
$params = getopt('h::v', array(
'templates::',
'tempDir::',
Function markdown
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context)
{
$method = __FUNCTION__;
$keyTags = \SwaggerValidator\Common\FactorySwagger::KEY_TAGS;
$generalItems = $this->getMethodGeneric($context, $method);
- 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 24 (exceeds 5 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context)
{
$method = __FUNCTION__;
$templateVars = array(
'items' => 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 makeRequestExample
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function makeRequestExample(\SwaggerValidator\Common\Context $context, $operation)
{
$keyParameters = \SwaggerValidator\Common\FactorySwagger::KEY_PARAMETERS;
$keyResponses = \SwaggerValidator\Common\FactorySwagger::KEY_RESPONSES;
$keyConsumes = \SwaggerValidator\Common\FactorySwagger::KEY_CONSUMES;
- 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 24 (exceeds 5 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context)
{
$method = __FUNCTION__;
$schemaKey = \SwaggerValidator\Common\FactorySwagger::KEY_SCHEMA;
$templateVars = 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 loadSwaggerFile
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function loadSwaggerFile($swaggerFile = null)
{
$params = getopt('h::v', array(
'templates::',
'tempDir::',
- 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
Method makeRequestExample
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function makeRequestExample(\SwaggerValidator\Common\Context $context, $operation)
{
$keyParameters = \SwaggerValidator\Common\FactorySwagger::KEY_PARAMETERS;
$keyResponses = \SwaggerValidator\Common\FactorySwagger::KEY_RESPONSES;
$keyConsumes = \SwaggerValidator\Common\FactorySwagger::KEY_CONSUMES;
Method markdown
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context)
{
$method = __FUNCTION__;
$templateVars = array(
'partType' => \Swagger2md\Swagger2md::getInstance()->renderTemplate('PartTypeFormat', array('type' => \SwaggerValidator\Common\FactorySwagger::TYPE_OBJECT)),
Method renderTable
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderTable($name, $anchor, $listKey, $colonsFile, $template, $vars, $store = null)
{
if ($store !== false) {
$file = $this->checkAndMakeObjectFolder();
}
Function getTags
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getTags(\SwaggerValidator\Common\Context $context, $tags)
{
$method = __FUNCTION__;
$keyTags = \SwaggerValidator\Common\FactorySwagger::KEY_TAGS;
$curPath = $context->getRoutePath();
- 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
Swagger2md
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Swagger2md
{
const version = '1.0.0';
Method markdown
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context)
{
$method = __FUNCTION__;
$schemaKey = \SwaggerValidator\Common\FactorySwagger::KEY_SCHEMA;
$templateVars = array();
Method markdown
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context, $generalItems)
{
$method = __FUNCTION__;
$generalItems = $this->getMethodGeneric($context, $method, $generalItems);
$exampleRequest = $this->makeRequestExample($context, $generalItems);
Method markdown
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context)
{
$method = __FUNCTION__;
$templateVars = array(
'items' => array(),
Method markdown
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context)
{
$method = __FUNCTION__;
$keyTags = \SwaggerValidator\Common\FactorySwagger::KEY_TAGS;
$generalItems = $this->getMethodGeneric($context, $method);
Function markdown
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context, $generalItems)
{
$method = __FUNCTION__;
$context->setType(\SwaggerValidator\Common\Context::TYPE_REQUEST);
- 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
Method getTags
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTags(\SwaggerValidator\Common\Context $context, $tags)
{
$method = __FUNCTION__;
$keyTags = \SwaggerValidator\Common\FactorySwagger::KEY_TAGS;
$curPath = $context->getRoutePath();
Function markdown
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function markdown(\SwaggerValidator\Common\Context $context, $generalItems)
{
$method = __FUNCTION__;
$generalItems = $this->getMethodGeneric($context, $method, $generalItems);
$exampleRequest = $this->makeRequestExample($context, $generalItems);
- 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"