dmelo/you2better

View on GitHub

Showing 7 of 7 total issues

Method saveUrl has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function saveUrl($url)
    {
        $this->logger->info("saving url: $url");
        $url = parse_url($url);
        $host = 'ssl://' . $url['host'];
Severity: Major
Found in src/YouBetter/YouBetter.php - About 3 hrs to fix

    Method processRequest has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function processRequest()
        {
            // config
            $conf = include('you2better-conf.php');
    
    
    Severity: Major
    Found in src/YouBetter/YouBetter.php - About 3 hrs to fix

      Function saveUrl has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          private function saveUrl($url)
          {
              $this->logger->info("saving url: $url");
              $url = parse_url($url);
              $host = 'ssl://' . $url['host'];
      Severity: Minor
      Found in src/YouBetter/YouBetter.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

      Function checkFileSize has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          private function checkFileSize($cacheFilenameHeader, $cacheFilenameContent)
          {
              $ret = false;
              if (($fd = fopen($cacheFilenameHeader, 'r')) !== false) {
                  while (!feof($fd)) {
      Severity: Minor
      Found in src/YouBetter/YouBetter.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

      Function processRequest has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public function processRequest()
          {
              // config
              $conf = include('you2better-conf.php');
      
      
      Severity: Minor
      Found in src/YouBetter/YouBetter.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

      Function getRange has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          static public function getRange($totalLength)
          {
              global $_SERVER;
              if (isset($_SERVER['HTTP_RANGE'])) {
                  if (null === self::$_range) {
      Severity: Minor
      Found in src/YouBetter/HttpRange.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

      Method checkFileSize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function checkFileSize($cacheFilenameHeader, $cacheFilenameContent)
          {
              $ret = false;
              if (($fd = fopen($cacheFilenameHeader, 'r')) !== false) {
                  while (!feof($fd)) {
      Severity: Minor
      Found in src/YouBetter/YouBetter.php - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language