njuhel/php-swagger-to-md

View on GitHub

Showing 45 of 181 total issues

Method markdown has 29 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);
        $tplResources = array();
Severity: Minor
Found in src/SwaggerValidator/Object/Paths.php - About 1 hr to fix

    Method autoload has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        final public static function autoload($className)
        {
            if (\Phar::running() && defined('PHAR_SWG2MD_ROOT_PATH')) {
                $baseDir = PHAR_SWG2MD_ROOT_PATH;
            }
    Severity: Minor
    Found in src/Swagger2mdAutoload.php - About 1 hr to fix

      Method getSummary has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getSummary(\SwaggerValidator\Common\Context $context)
          {
              $method = __FUNCTION__;
      
              $summary  = array();
      Severity: Minor
      Found in src/SwaggerValidator/Object/Paths.php - About 1 hr to fix

        Method markdown has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function markdown(\SwaggerValidator\Common\Context $context, $generalItems)
            {
                $method = __FUNCTION__;
                $context->setType(\SwaggerValidator\Common\Context::TYPE_REQUEST);
        
        
        Severity: Minor
        Found in src/SwaggerValidator/Object/Parameters.php - About 1 hr to fix

          Method markdown has 26 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);
                  $tplOperation = array();
          Severity: Minor
          Found in src/SwaggerValidator/Object/PathItem.php - About 1 hr to fix

            Function autoload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                final public static function autoload($className)
                {
                    if (\Phar::running() && defined('PHAR_SWG2MD_ROOT_PATH')) {
                        $baseDir = PHAR_SWG2MD_ROOT_PATH;
                    }
            Severity: Minor
            Found in src/Swagger2mdAutoload.php - About 55 mins to fix

            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 renderTable has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function renderTable($name, $anchor, $listKey, $colonsFile, $template, $vars, $store = null)
            Severity: Major
            Found in src/Swagger2md.php - About 50 mins to fix

              Function apache_request_headers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  function apache_request_headers()
                  {
                      $arh = array();
              
                      foreach ($_SERVER as $key => $val) {
              Severity: Minor
              Found in src/Compat.php - About 45 mins to fix

              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 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;
                      }
              Severity: Minor
              Found in src/Swagger2md.php - About 35 mins to fix

              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();
              Severity: Minor
              Found in src/SwaggerValidator/Object/Paths.php - About 35 mins to fix

              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();
                      }
              Severity: Minor
              Found in src/Swagger2md.php - About 35 mins to fix

              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();
              Severity: Minor
              Found in src/SwaggerValidator/Object/Paths.php - About 35 mins to fix

              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;
              Severity: Major
              Found in src/Swagger2md.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return $this->twigTpl->render($template, $vars);
                Severity: Major
                Found in src/Swagger2md.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return $val;
                  Severity: Major
                  Found in src/Swagger2md.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return $val;
                    Severity: Major
                    Found in src/Swagger2md.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $this->tempFolder . DIRECTORY_SEPARATOR;
                      Severity: Major
                      Found in src/Swagger2md.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return $val['enabled'];
                        Severity: Major
                        Found in src/Swagger2md.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return array_filter($colParamsTitle);
                          Severity: Major
                          Found in src/Swagger2md.php - About 30 mins to fix

                            Function markdown has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function markdown(\SwaggerValidator\Common\Context $context)
                                {
                                    $method       = __FUNCTION__;
                                    $templateVars = array();
                            
                            
                            Severity: Minor
                            Found in src/SwaggerValidator/DataType/TypeBoolean.php - About 25 mins to fix

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language