Showing 8 of 19 total issues
Method init_file_stream_transfer
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init_file_stream_transfer($name, $size, array $opt = array(), $meth = null)
{
// try to detect the type if not provided
$type = self::REGTYPE;
if (isset($opt['type']))
Method send_http_headers
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function send_http_headers()
{
// grab options
$opt = $this->opt;
Method add_cdr_file
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function add_cdr_file(array $args)
{
list($name, $opt, $meth, $crc, $zlen, $len, $ofs, $genb, $file_attribute) = $args;
// convert the 64 bit ints to 2 32bit ints
Method add_stream_file_header
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function add_stream_file_header($name, $size, array $opt, $meth)
{
// strip leading slashes from file name
// (fixes bug in windows archive viewer)
$name = preg_replace('/^\\/+/', '', $name);
Method add_to_cdr
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
private function add_to_cdr($name, array $opt, $meth, $crc, $zlen, $len, $rec_len, $genb = 0, $fattr = 0x20)
Function init_file_stream_transfer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function init_file_stream_transfer($name, $size, array $opt = array(), $meth = null)
{
// try to detect the type if not provided
$type = self::REGTYPE;
if (isset($opt['type']))
- 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 __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(
$name = null,
array $opt = array(),
$base_path = null,
$output_stream = null
- 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 send_http_headers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function send_http_headers()
{
// grab options
$opt = $this->opt;
- 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"