DerDu/MOC-Framework-Mark-V

View on GitHub
Component/Document/Vendor/PhpOfficeCommon/0.2.6/src/Common/Microsoft/OLERead.php

Summary

Maintainability
C
1 day
Test Coverage

Method read has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function read($sFileName)
    {
        // Check if file exists and is readable
        if (!is_readable($sFileName)) {
            throw new \Exception("Could not open " . $sFileName . " for reading! File does not exist, or it is not readable.");

    Method readPropertySets has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function readPropertySets()
        {
            $offset = 0;
    
            // loop through entires, each entry is 128 bytes

      Function readPropertySets has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          private function readPropertySets()
          {
              $offset = 0;
      
              // loop through entires, each entry is 128 bytes

      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 read has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function read($sFileName)
          {
              // Check if file exists and is readable
              if (!is_readable($sFileName)) {
                  throw new \Exception("Could not open " . $sFileName . " for reading! File does not exist, or it is not readable.");

      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 getStream has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getStream($stream)
          {
              if ($stream === null) {
                  return null;
              }

      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 getStream has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getStream($stream)
          {
              if ($stream === null) {
                  return null;
              }

        There are no issues that match your filters.

        Category
        Status