Function parseHeader
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
public function parseHeader($subj, $from, $date, $messageid, $rsaKeys)
{
// Initialize an empty array, we create a basic template in a few
$spot = [];
- 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 parseHeader
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseHeader($subj, $from, $date, $messageid, $rsaKeys)
{
// Initialize an empty array, we create a basic template in a few
$spot = [];
Function parseFull
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function parseFull($xmlStr)
{
// Create a template array so we always have the full fields to prevent ugly notices
$tpl_spot = ['category' => '', 'website' => '', 'image' => '', 'sabnzbdurl' => '', 'messageid' => '', 'searchurl' => '', 'description' => '',
'sub' => '', 'filesize' => '', 'poster' => '', 'tag' => '', 'nzb' => [], 'title' => '',
- 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 parseFull
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseFull($xmlStr)
{
// Create a template array so we always have the full fields to prevent ugly notices
$tpl_spot = ['category' => '', 'website' => '', 'image' => '', 'sabnzbdurl' => '', 'messageid' => '', 'searchurl' => '', 'description' => '',
'sub' => '', 'filesize' => '', 'poster' => '', 'tag' => '', 'nzb' => [], 'title' => '',
File Services_Format_Parsing.php
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class Services_Format_Parsing
{
private $_spotSigning = null;
Avoid deeply nested control flow statements. Open
if ($this->_spotSigning->verifySpotHeader($spot, $signature, $userRsaKey)) {
$spot['spotterid'] = $this->_util->calculateSpotterId($spot['selfsignedpubkey']);
} // if
Method parseHeader
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function parseHeader($subj, $from, $date, $messageid, $rsaKeys)
Function correctElmContents
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function correctElmContents($xmlStr, $elems)
{
$cdataStart = '<![CDATA[';
$cdataEnd = ']]>';
- 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 $spot;
Avoid too many return
statements within this method. Open
return $spot;