Showing 9 of 9 total issues
SambaStreamWrapper
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class SambaStreamWrapper
{
const PROTOCOL = 'smb';
/**
File SambaClient.php
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Samba;
class SambaClient
Method parseOutput
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseOutput($output)
{
$info = array();
while (($line = fgets($output)) !== false) {
SambaClient
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class SambaClient
{
const SOCKET_OPTIONS = "TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192";
const CLIENT = "smbclient";
Function parseOutput
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function parseOutput($output)
{
$info = array();
while (($line = fgets($output)) !== 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
Method parseUrl
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseUrl($url)
{
$this->url = trim($url);
$parsedUrl = parse_url($this->url);
Function parseUrl
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function parseUrl($url)
{
$this->url = trim($url);
$parsedUrl = parse_url($this->url);
- 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 dir_opendir
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function dir_opendir($path, $options)
{
$url = $this->client()->parseUrl($path);
switch ($url->getType()) {
- 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 shareInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function shareInfo(SambaUrl $url)
{
$lowerShare = strtolower($url->getShare()); # fix by Eric Leung
if ($lookInfo = $this->look($url)) {
- 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"