crystalservice/samba

View on GitHub

Showing 9 of 9 total issues

SambaStreamWrapper has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

class SambaStreamWrapper
{
    const PROTOCOL = 'smb';

    /**
Severity: Minor
Found in src/Samba/SambaStreamWrapper.php - About 3 hrs to fix

    File SambaClient.php has 289 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Samba;
    
    class SambaClient
    Severity: Minor
    Found in src/Samba/SambaClient.php - About 2 hrs to fix

      Method parseOutput has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function parseOutput($output)
          {
              $info = array();
      
              while (($line = fgets($output)) !== false) {
      Severity: Major
      Found in src/Samba/SambaClient.php - About 2 hrs to fix

        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";
        
        
        Severity: Minor
        Found in src/Samba/SambaClient.php - About 2 hrs to fix

          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) {
          Severity: Minor
          Found in src/Samba/SambaClient.php - About 2 hrs 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 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);
          Severity: Minor
          Found in src/Samba/SambaUrl.php - About 1 hr to fix

            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);
            Severity: Minor
            Found in src/Samba/SambaUrl.php - About 1 hr 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 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()) {
            Severity: Minor
            Found in src/Samba/SambaStreamWrapper.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 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)) {
            Severity: Minor
            Found in src/Samba/SambaClient.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