barracudanetworks/ArchiveStream-php

View on GitHub

Showing 19 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']))
Severity: Major
Found in src/TarArchive.php - About 2 hrs to fix

    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;
    
    
    Severity: Minor
    Found in src/Archive.php - About 1 hr to fix

      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
      Severity: Minor
      Found in src/ZipArchive.php - About 1 hr to fix

        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);
        Severity: Minor
        Found in src/ZipArchive.php - About 1 hr to fix

          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)
          Severity: Major
          Found in src/ZipArchive.php - About 1 hr to fix

            Missing file doc comment
            Open

            namespace Barracuda\ArchiveStream;
            Severity: Minor
            Found in src/Archive.php by phpcodesniffer

            Missing file doc comment
            Open

            namespace Barracuda\ArchiveStream;
            Severity: Minor
            Found in src/TarArchive.php by phpcodesniffer

            Expected 1 newline after closing parenthesis; 0 found
            Open

                            if ($output_stream === null) {
            Severity: Minor
            Found in src/Archive.php by phpcodesniffer

            Missing file doc comment
            Open

            namespace Barracuda\ArchiveStream;
            Severity: Minor
            Found in src/ZipArchive.php by phpcodesniffer

            Expected 1 newline after closing parenthesis; 0 found
            Open

                            if ($output_stream === null) {
            Severity: Minor
            Found in src/Archive.php by phpcodesniffer

            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']))
            Severity: Minor
            Found in src/TarArchive.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 __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
            Severity: Minor
            Found in src/Archive.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

            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;
            
            
            Severity: Minor
            Found in src/Archive.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

            Line indented incorrectly; expected 8 spaces, found 16
            Open

                            }
            Severity: Minor
            Found in src/Archive.php by phpcodesniffer

            Line indented incorrectly; expected 8 spaces, found 16
            Open

                            if ($output_stream === null) {
            Severity: Minor
            Found in src/Archive.php by phpcodesniffer

            Line indented incorrectly; expected 8 spaces, found 16
            Open

                            }
            Severity: Minor
            Found in src/Archive.php by phpcodesniffer

            Line indented incorrectly; expected 8 spaces, found 16
            Open

                            if ($output_stream === null) {
            Severity: Minor
            Found in src/Archive.php by phpcodesniffer

            Whitespace found at end of line
            Open

                {        
            Severity: Minor
            Found in src/Archive.php by phpcodesniffer

            FIXME found
            Open

                        // FIXME: Really? We just die here? Can we detect GMP in __constructor() instead maybe?
            Severity: Minor
            Found in src/Archive.php by fixme
            Severity
            Category
            Status
            Source
            Language