Showing 10 of 18 total issues
File CiscoLoader.php
has 599 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Detain\CiscoParser;
/**
Method show_int
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show_int($int)
{
$result = [];
$this->exec('show int '.$int);
$this->_data = explode("\r\n", $this->_data);
Function show_int
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
public function show_int($int)
{
$result = [];
$this->exec('show int '.$int);
$this->_data = explode("\r\n", $this->_data);
- 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 parse_cisco_children
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function parse_cisco_children($lines, $x = 0, $depth = 0)
{
//global $x;
$data = [];
$last_command = false;
- 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
CiscoLoader
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class CiscoLoader
{
/**
* @var bool
*/
Method parse_cisco_children
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse_cisco_children($lines, $x = 0, $depth = 0)
{
//global $x;
$data = [];
$last_command = false;
Method show_int_status
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show_int_status()
{
$result = [];
$this->exec('show int status');
$this->_data = explode("\r\n", $this->_data);
Function read
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function read($pattern = '', $regex = false)
{
//usleep(1000);
$this->_response = '';
$match = $pattern;
- 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 arp_table
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function arp_table()
{
$result = [];
$this->exec('show arp | exc Incomplete');
$this->_data = explode("\r\n", $this->_data);
- 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 configure
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function configure($config)
{
// USE AT OWN RISK: This function will apply configuration statements to a device.
// Enabled Only
if (mb_strpos($this->_prompt, '#') === false) {
- 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"