attogram/attogram

View on GitHub
Attogram/Attogram.php

Summary

Maintainability
F
4 days
Test Coverage

sessioning accesses the super-global variable $_SESSION.
Open

    public function sessioning()
    {
        session_start();
        $this->log->debug('Session started.', $_SESSION);
        if ($this->request->query->has('logoff')) {
Severity: Minor
Found in Attogram/Attogram.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

File Attogram.php has 680 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// Attogram Framework - Attogram class v0.5.6

namespace Attogram;

Severity: Major
Found in Attogram/Attogram.php - About 1 day to fix

    Attogram has 31 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Attogram
    {
        const ATTOGRAM_VERSION = '0.8.2';
    
        public $startTime;          // (float) microsecond time of awakening
    Severity: Minor
    Found in Attogram/Attogram.php - About 3 hrs to fix

      The class Attogram has an overall complexity of 149 which is very high. The configured complexity threshold is 50.
      Open

      class Attogram
      {
          const ATTOGRAM_VERSION = '0.8.2';
      
          public $startTime;          // (float) microsecond time of awakening
      Severity: Minor
      Found in Attogram/Attogram.php by phpmd

      The class Attogram has 19 public methods. Consider refactoring Attogram to keep number of public methods under 10.
      Open

      class Attogram
      {
          const ATTOGRAM_VERSION = '0.8.2';
      
          public $startTime;          // (float) microsecond time of awakening
      Severity: Minor
      Found in Attogram/Attogram.php by phpmd

      TooManyPublicMethods

      Since: 0.1

      A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

      By default it ignores methods starting with 'get' or 'set'.

      Example

      Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

      Method awaken has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function awaken()
          {
              // The Site Administrator IP addresses
              $this->remember(
                  'admins',
      Severity: Major
      Found in Attogram/Attogram.php - About 2 hrs to fix

        Function getMimeType has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getMimeType($file)
            {
                $mimeType = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $file);
                switch (pathinfo($file, PATHINFO_EXTENSION)) { // https://bugs.php.net/bug.php?id=53035
                    case 'html':
        Severity: Minor
        Found in Attogram/Attogram.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 getMimeType has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function getMimeType($file)
            {
                $mimeType = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $file);
                switch (pathinfo($file, PATHINFO_EXTENSION)) { // https://bugs.php.net/bug.php?id=53035
                    case 'html':
        Severity: Minor
        Found in Attogram/Attogram.php - About 1 hr to fix

          Method route has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function route()
              {
                  if (is_dir($this->uri[0])) {  // requesting a directory?
                      $this->log->error('ROUTE: 403 Action Forbidden');
                      $this->error404('No spelunking allowed');
          Severity: Minor
          Found in Attogram/Attogram.php - About 1 hr to fix

            Method defaultHomepage has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function defaultHomepage()
                {
                    $this->log->error('using defaultHomepage');
                    $this->pageHeader('Home');
                    echo '<div class="container">'
            Severity: Minor
            Found in Attogram/Attogram.php - About 1 hr to fix

              Function virtualWebDirectory has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function virtualWebDirectory()
                  {
                      if (!preg_match('/^\/'.'web'.'\//', $this->request->getPathInfo())) {
                          return; // not a virtual web directory request
                      }
              Severity: Minor
              Found in Attogram/Attogram.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 route has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function route()
                  {
                      if (is_dir($this->uri[0])) {  // requesting a directory?
                          $this->log->error('ROUTE: 403 Action Forbidden');
                          $this->error404('No spelunking allowed');
              Severity: Minor
              Found in Attogram/Attogram.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 virtualWebDirectory has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function virtualWebDirectory()
                  {
                      if (!preg_match('/^\/'.'web'.'\//', $this->request->getPathInfo())) {
                          return; // not a virtual web directory request
                      }
              Severity: Minor
              Found in Attogram/Attogram.php - About 1 hr to fix

                The class Attogram has 20 fields. Consider redesigning Attogram to keep the number of fields under 15.
                Open

                class Attogram
                {
                    const ATTOGRAM_VERSION = '0.8.2';
                
                    public $startTime;          // (float) microsecond time of awakening
                Severity: Minor
                Found in Attogram/Attogram.php by phpmd

                TooManyFields

                Since: 0.1

                Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                Example

                class Person {
                   protected $one;
                   private $two;
                   private $three;
                   [... many more fields ...]
                }

                Source https://phpmd.org/rules/codesize.html#toomanyfields

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

                    public function getActionables($dir)
                    {
                        $result = array();
                        if (!is_readable($dir)) {
                            $this->log->error('GET_ACTIONABLES: directory not readable: '.$dir);
                Severity: Minor
                Found in Attogram/Attogram.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

                The class Attogram has 51 public methods and attributes. Consider reducing the number of public items to less than 45.
                Open

                class Attogram
                {
                    const ATTOGRAM_VERSION = '0.8.2';
                
                    public $startTime;          // (float) microsecond time of awakening
                Severity: Minor
                Found in Attogram/Attogram.php by phpmd

                ExcessivePublicCount

                Since: 0.1

                A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

                Example

                public class Foo {
                    public $value;
                    public $something;
                    public $var;
                    // [... more more public attributes ...]
                
                    public function doWork() {}
                    public function doMoreWork() {}
                    public function doWorkAgain() {}
                    // [... more more public methods ...]
                }

                Source https://phpmd.org/rules/codesize.html#excessivepubliccount

                Method endSlash has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function endSlash()
                    {
                        if (!is_array($this->noEndSlash)) {
                            return;
                        }
                Severity: Minor
                Found in Attogram/Attogram.php - About 1 hr to fix

                  Function getAllSubdirectories has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function getAllSubdirectories($dir, $name)
                      {
                          if (!isset($dir) || !$dir || !is_string($dir) || !is_readable($dir)) {
                              return array();
                          }
                  Severity: Minor
                  Found in Attogram/Attogram.php - About 55 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 setModuleTemplates has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function setModuleTemplates()
                      {
                          $dirs = $this->getAllSubdirectories($this->modulesDirectory, 'templates');
                          if (!$dirs) {
                              //$this->log->debug('setModuleTemplates: no module templates found. Using defaults.');
                  Severity: Minor
                  Found in Attogram/Attogram.php - About 45 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

                  Consider simplifying this complex logical expression.
                  Open

                          if (!$file || !$type || $type == '' || !is_string($type) || !is_string($file) || !is_readable($file)) {
                              return false;
                          }
                  Severity: Major
                  Found in Attogram/Attogram.php - About 40 mins to fix

                    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            \Psr\Log\LoggerInterface $log,
                            \Psr\Log\LoggerInterface $event,
                            \Attogram\AttogramDatabaseInterface $database,
                            \Symfony\Component\HttpFoundation\Request $request,
                            array $config = array()
                    Severity: Minor
                    Found in Attogram/Attogram.php - About 35 mins to fix

                      Function defaultHomepage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function defaultHomepage()
                          {
                              $this->log->error('using defaultHomepage');
                              $this->pageHeader('Home');
                              echo '<div class="container">'
                      Severity: Minor
                      Found in Attogram/Attogram.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 includeAllPhpFilesInDirectory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function includeAllPhpFilesInDirectory($dir)
                          {
                              $included = array();
                              if (!is_readable($dir)) {
                                  return $included;
                      Severity: Minor
                      Found in Attogram/Attogram.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

                      Avoid too many return statements within this method.
                      Open

                              return false;
                      Severity: Major
                      Found in Attogram/Attogram.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return $content;
                        Severity: Major
                        Found in Attogram/Attogram.php - About 30 mins to fix

                          Function isAdmin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function isAdmin()
                              {
                                  if (isset($this->isAdmin) && is_bool($this->isAdmin)) {
                                      return $this->isAdmin;
                                  }
                          Severity: Minor
                          Found in Attogram/Attogram.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 awaken has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function awaken()
                              {
                                  // The Site Administrator IP addresses
                                  $this->remember(
                                      'admins',
                          Severity: Minor
                          Found in Attogram/Attogram.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 exceptionFiles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function exceptionFiles()
                              {
                                  switch ($this->request->getPathInfo()) {
                                      case '/robots.txt':
                                          header('Content-Type: text/plain; charset=utf-8');
                          Severity: Minor
                          Found in Attogram/Attogram.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

                          The method virtualWebDirectory() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
                          Open

                              public function virtualWebDirectory()
                              {
                                  if (!preg_match('/^\/'.'web'.'\//', $this->request->getPathInfo())) {
                                      return; // not a virtual web directory request
                                  }
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          NPathComplexity

                          Since: 0.1

                          The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                          Example

                          class Foo {
                              function bar() {
                                  // lots of complicated code
                              }
                          }

                          Source https://phpmd.org/rules/codesize.html#npathcomplexity

                          The method getMimeType() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
                          Open

                              public static function getMimeType($file)
                              {
                                  $mimeType = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $file);
                                  switch (pathinfo($file, PATHINFO_EXTENSION)) { // https://bugs.php.net/bug.php?id=53035
                                      case 'html':
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          CyclomaticComplexity

                          Since: 0.1

                          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                          Example

                          // Cyclomatic Complexity = 11
                          class Foo {
                          1   public function example() {
                          2       if ($a == $b) {
                          3           if ($a1 == $b1) {
                                          fiddle();
                          4           } elseif ($a2 == $b2) {
                                          fiddle();
                                      } else {
                                          fiddle();
                                      }
                          5       } elseif ($c == $d) {
                          6           while ($c == $d) {
                                          fiddle();
                                      }
                          7        } elseif ($e == $f) {
                          8           for ($n = 0; $n < $h; $n++) {
                                          fiddle();
                                      }
                                  } else {
                                      switch ($z) {
                          9               case 1:
                                              fiddle();
                                              break;
                          10              case 2:
                                              fiddle();
                                              break;
                          11              case 3:
                                              fiddle();
                                              break;
                                          default:
                                              fiddle();
                                              break;
                                      }
                                  }
                              }
                          }

                          Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                          The method virtualWebDirectory() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                          Open

                              public function virtualWebDirectory()
                              {
                                  if (!preg_match('/^\/'.'web'.'\//', $this->request->getPathInfo())) {
                                      return; // not a virtual web directory request
                                  }
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          CyclomaticComplexity

                          Since: 0.1

                          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                          Example

                          // Cyclomatic Complexity = 11
                          class Foo {
                          1   public function example() {
                          2       if ($a == $b) {
                          3           if ($a1 == $b1) {
                                          fiddle();
                          4           } elseif ($a2 == $b2) {
                                          fiddle();
                                      } else {
                                          fiddle();
                                      }
                          5       } elseif ($c == $d) {
                          6           while ($c == $d) {
                                          fiddle();
                                      }
                          7        } elseif ($e == $f) {
                          8           for ($n = 0; $n < $h; $n++) {
                                          fiddle();
                                      }
                                  } else {
                                      switch ($z) {
                          9               case 1:
                                              fiddle();
                                              break;
                          10              case 2:
                                              fiddle();
                                              break;
                          11              case 3:
                                              fiddle();
                                              break;
                                          default:
                                              fiddle();
                                              break;
                                      }
                                  }
                              }
                          }

                          Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                          The method route() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                          Open

                              public function route()
                              {
                                  if (is_dir($this->uri[0])) {  // requesting a directory?
                                      $this->log->error('ROUTE: 403 Action Forbidden');
                                      $this->error404('No spelunking allowed');
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          CyclomaticComplexity

                          Since: 0.1

                          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                          Example

                          // Cyclomatic Complexity = 11
                          class Foo {
                          1   public function example() {
                          2       if ($a == $b) {
                          3           if ($a1 == $b1) {
                                          fiddle();
                          4           } elseif ($a2 == $b2) {
                                          fiddle();
                                      } else {
                                          fiddle();
                                      }
                          5       } elseif ($c == $d) {
                          6           while ($c == $d) {
                                          fiddle();
                                      }
                          7        } elseif ($e == $f) {
                          8           for ($n = 0; $n < $h; $n++) {
                                          fiddle();
                                      }
                                  } else {
                                      switch ($z) {
                          9               case 1:
                                              fiddle();
                                              break;
                          10              case 2:
                                              fiddle();
                                              break;
                          11              case 3:
                                              fiddle();
                                              break;
                                          default:
                                              fiddle();
                                              break;
                                      }
                                  }
                              }
                          }

                          Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                          Remove error control operator '@' on line 123.
                          Open

                              public function awaken()
                              {
                                  // The Site Administrator IP addresses
                                  $this->remember(
                                      'admins',
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ErrorControlOperator

                          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                          Example

                          function foo($filePath) {
                              $file = @fopen($filPath); // hides exceptions
                              $key = @$array[$notExistingKey]; // assigns null to $key
                          }

                          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                          Missing class import via use statement (line '448', column '23').
                          Open

                                  $parser = new \ParsedownExtra();
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          MissingImport

                          Since: 2.7.0

                          Importing all external classes in a file through use statements makes them clearly visible.

                          Example

                          function make() {
                              return new \stdClass();
                          }

                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                          Remove error control operator '@' on line 592.
                          Open

                              public function isAdmin()
                              {
                                  if (isset($this->isAdmin) && is_bool($this->isAdmin)) {
                                      return $this->isAdmin;
                                  }
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ErrorControlOperator

                          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                          Example

                          function foo($filePath) {
                              $file = @fopen($filPath); // hides exceptions
                              $key = @$array[$notExistingKey]; // assigns null to $key
                          }

                          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                          Remove error control operator '@' on line 90.
                          Open

                              public function awaken()
                              {
                                  // The Site Administrator IP addresses
                                  $this->remember(
                                      'admins',
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ErrorControlOperator

                          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                          Example

                          function foo($filePath) {
                              $file = @fopen($filPath); // hides exceptions
                              $key = @$array[$notExistingKey]; // assigns null to $key
                          }

                          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                          Remove error control operator '@' on line 128.
                          Open

                              public function awaken()
                              {
                                  // The Site Administrator IP addresses
                                  $this->remember(
                                      'admins',
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ErrorControlOperator

                          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                          Example

                          function foo($filePath) {
                              $file = @fopen($filPath); // hides exceptions
                              $key = @$array[$notExistingKey]; // assigns null to $key
                          }

                          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                          Remove error control operator '@' on line 105.
                          Open

                              public function awaken()
                              {
                                  // The Site Administrator IP addresses
                                  $this->remember(
                                      'admins',
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ErrorControlOperator

                          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                          Example

                          function foo($filePath) {
                              $file = @fopen($filPath); // hides exceptions
                              $key = @$array[$notExistingKey]; // assigns null to $key
                          }

                          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                          Remove error control operator '@' on line 133.
                          Open

                              public function awaken()
                              {
                                  // The Site Administrator IP addresses
                                  $this->remember(
                                      'admins',
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ErrorControlOperator

                          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                          Example

                          function foo($filePath) {
                              $file = @fopen($filPath); // hides exceptions
                              $key = @$array[$notExistingKey]; // assigns null to $key
                          }

                          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                          Remove error control operator '@' on line 388.
                          Open

                              public function doCacheHeaders($file)
                              {
                                  if (!$lastmod = filemtime($file)) {
                                      $lastmod = time();
                                  }
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ErrorControlOperator

                          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                          Example

                          function foo($filePath) {
                              $file = @fopen($filPath); // hides exceptions
                              $key = @$array[$notExistingKey]; // assigns null to $key
                          }

                          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                          Remove error control operator '@' on line 95.
                          Open

                              public function awaken()
                              {
                                  // The Site Administrator IP addresses
                                  $this->remember(
                                      'admins',
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ErrorControlOperator

                          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                          Example

                          function foo($filePath) {
                              $file = @fopen($filPath); // hides exceptions
                              $key = @$array[$notExistingKey]; // assigns null to $key
                          }

                          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                          Remove error control operator '@' on line 442.
                          Open

                              public function getMarkdown($file)
                              {
                                  if (!$this->isReadableFile($file, '.md')) {
                                      $this->log->error('GET_MARKDOWN: can not read file: '
                                          .$this->webDisplay($file));
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ErrorControlOperator

                          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                          Example

                          function foo($filePath) {
                              $file = @fopen($filPath); // hides exceptions
                              $key = @$array[$notExistingKey]; // assigns null to $key
                          }

                          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                          Remove error control operator '@' on line 100.
                          Open

                              public function awaken()
                              {
                                  // The Site Administrator IP addresses
                                  $this->remember(
                                      'admins',
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ErrorControlOperator

                          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                          Example

                          function foo($filePath) {
                              $file = @fopen($filPath); // hides exceptions
                              $key = @$array[$notExistingKey]; // assigns null to $key
                          }

                          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                          Avoid assigning values to variables in if clauses and the like (line '383', column '14').
                          Open

                              public function doCacheHeaders($file)
                              {
                                  if (!$lastmod = filemtime($file)) {
                                      $lastmod = time();
                                  }
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          IfStatementAssignment

                          Since: 2.7.0

                          Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                          Example

                          class Foo
                          {
                              public function bar($flag)
                              {
                                  if ($foo = 'bar') { // possible typo
                                      // ...
                                  }
                                  if ($baz = 0) { // always false
                                      // ...
                                  }
                              }
                          }

                          Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                          The method shutdown() contains an exit expression.
                          Open

                                  exit; // The Final Exit
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ExitExpression

                          Since: 0.2

                          An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

                          Example

                          class Foo {
                              public function bar($param)  {
                                  if ($param === 42) {
                                      exit(23);
                                  }
                              }
                          }

                          Source https://phpmd.org/rules/design.html#exitexpression

                          Avoid unused local variables such as '$trash'.
                          Open

                                      $trash = array_shift($this->uri); // take off first blank entry
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          UnusedLocalVariable

                          Since: 0.2

                          Detects when a local variable is declared and/or assigned, but not used.

                          Example

                          class Foo {
                              public function doSomething()
                              {
                                  $i = 5; // Unused
                              }
                          }

                          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                          Avoid unused local variables such as '$trash'.
                          Open

                                  $trash = array_shift($test); // take off top level
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          UnusedLocalVariable

                          Since: 0.2

                          Detects when a local variable is declared and/or assigned, but not used.

                          Example

                          class Foo {
                              public function doSomething()
                              {
                                  $i = 5; // Unused
                              }
                          }

                          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                          Call to method getPathInfo from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                          rtrim($this->request->getPathInfo(), '/'),
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Doc-block of $log in __construct contains phpdoc param type \Attogram\obj which is incompatible with the param type \Psr\Log\LoggerInterface declared in the signature
                          Open

                               * @param obj  $log      Debug PSR-3 logger object, interface: \Psr\Log\LoggerInterface
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Doc-block of $database in __construct contains phpdoc param type \Attogram\obj which is incompatible with the param type \Attogram\AttogramDatabaseInterface declared in the signature
                          Open

                               * @param obj  $database Attogram Database object, interface: \Attogram\AttogramDatabaseInterface
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method getPathInfo from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                              $this->request->getPathInfo().'/',
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('START The Attogram Framework v'.self::ATTOGRAM_VERSION);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method getClientIp from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  $this->log->debug('HOST: '.$this->request->getHost().' IP: '.$this->request->getClientIp());
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Argument 3 (defaultVal) is array{} but \Attogram\Attogram::remember() takes string defined at /code/Attogram/Attogram.php:178
                          Open

                                      array()
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->debug('setUri', $this->uri);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->debug('setUri', $this->uri);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method getRequestUri from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                          $this->request->getRequestUri()
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method getRequestUri from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                              $this->request->getRequestUri()
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method getHost from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  $this->log->debug('HOST: '.$this->request->getHost().' IP: '.$this->request->getClientIp());
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Argument 3 (defaultVal) is array{0:'127.0.0.1',1:'::1'} but \Attogram\Attogram::remember() takes string defined at /code/Attogram/Attogram.php:178
                          Open

                                      array('127.0.0.1', '::1')
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method getPathInfo from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  $this->uri = explode('/', $this->request->getPathInfo());
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Saw an @param annotation for configuration, but it was not found in the param list of function __construct(\Psr\Log\LoggerInterface $log, \Psr\Log\LoggerInterface $event, \Attogram\AttogramDatabaseInterface $database, \Symfony\Component\HttpFoundation\Request $request, array $config = null)
                          Open

                               * @param array $configuration  (optional) List of configuration values
                          Severity: Info
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('CONFIG:', $this->config);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Argument 3 (defaultVal) is array{} but \Attogram\Attogram::remember() takes string defined at /code/Attogram/Attogram.php:178
                          Open

                                      array()
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('setUri', $this->uri);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                          $this->log->error('setModuleTemplates: File not readable: '.$file);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('SetModuleTemplates: ', $this->templates);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method getPathInfo from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  if (!preg_match('/\/$/', $this->request->getPathInfo())) {
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Doc-block of $request in __construct contains phpdoc param type \Attogram\obj which is incompatible with the param type \Symfony\Component\HttpFoundation\Request declared in the signature
                          Open

                               * @param obj  $request  Request object, \Symfony\Component\HttpFoundation\Request
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Parameter $request has undeclared type \Symfony\Component\HttpFoundation\Request
                          Open

                              public function __construct(
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method getBasePath from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  $this->path = $this->request->getBasePath();
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('HOST: '.$this->request->getHost().' IP: '.$this->request->getClientIp());
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Parameter $log has undeclared type \Psr\Log\LoggerInterface
                          Open

                              public function __construct(
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method getPathInfo from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                              $this->request->getPathInfo(),
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Doc-block of $event in __construct contains phpdoc param type \Attogram\obj which is incompatible with the param type \Psr\Log\LoggerInterface declared in the signature
                          Open

                               * @param obj  $event    Event PSR-3 logger object, interface: \Psr\Log\LoggerInterface
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Parameter $event has undeclared type \Psr\Log\LoggerInterface
                          Open

                              public function __construct(
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method getPathInfo from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                          $this->request->getPathInfo(),
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('isAdmin false '.$cip);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method getPathInfo from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  if (!preg_match('/^\/'.'web'.'\//', $this->request->getPathInfo())) {
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->error('virtualWebDirectory: can not include file: '.$this->webDisplay($file));
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Reference to instance property server from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  $serverIfNone = trim($this->request->server->get('HTTP_IF_NONE_MATCH'));
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->error('GET_MARKDOWN: can not find parser');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->error('missing pageHeader '.$file.' - using default header');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->debug('pageFooter');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method getPathInfo from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  switch ($this->request->getPathInfo()) {
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->debug('getAdminActions: No module admin actions found');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->debug('isAdmin false - noadmin override');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->debug('isAdmin true '.$cip);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->error('URI Depth ERROR. uri='.sizeof($this->uri).' allowed='.$depth);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->error('ROUTE: 403 Action Forbidden');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                          $this->log->error('virtualWebDirectory: can not read file: '.$this->webDisplay($file));
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Reference to instance property server from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  $serverIfMod = @strtotime($this->request->server->get('HTTP_IF_MODIFIED_SINCE'));
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->error('GET_MARKDOWN: can not get file contents: '
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Reference to instance property query from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  if ($this->request->query->has('noadmin')) {
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method getClientIp from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  $cip = $this->request->getClientIp();
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('ROUTE: action: uri[0]: '.$this->uri[0]);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method __construct from undeclared class \ParsedownExtra
                          Open

                                  $parser = new \ParsedownExtra();
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('Session started.', $_SESSION);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                              $this->log->error('ROUTE: No Parser Found');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Reference to undeclared constant \FILEINFO_MIME_TYPE
                          Open

                                  $mimeType = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $file);
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('DO_MARKDOWN: '.$file);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->error('ERROR404: 404 template not found');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method text from undeclared class \ParsedownExtra
                          Open

                                  $content = $parser->text($page);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('getAdminActions: ', array_keys($this->adminActions));
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->debug('pageHeader, title: '.$title);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                                  $this->log->error('ROUTE: Unreadable action');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->error('ROUTE: Action not found.  uri[0]='.$this->uri[0]);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('getActions: ', array_keys($this->actions));
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug('ERROR404: exit');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                                  $this->log->error('ROUTE: Missing action');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method getPathInfo from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  $test = explode('/', $this->request->getPathInfo());
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->debug('getActions: No module actions found');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->error('using defaultHomepage');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method info from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->info('User loggged off');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->debug('ERROR404: exit');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->error('GET_ACTIONABLES: directory not readable: '.$dir);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->error('isAdmin false - missing $this->admins  array');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Reference to undeclared constant \ATTOGRAM_VERSION (Did you mean self::ATTOGRAM_VERSION)
                          Open

                                      .ATTOGRAM_VERSION.'</a></p>'
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->error('missing pageFooter '.$file.' - using default footer');
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Reference to instance property query from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  if ($this->request->query->has('logoff')) {
                          Severity: Minor
                          Found in Attogram/Attogram.php by phan

                          Call to method getSchemeAndHttpHost from undeclared class \Symfony\Component\HttpFoundation\Request
                          Open

                                  return $this->request->getSchemeAndHttpHost().$this->path;
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                  $this->log->debug(
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->error('GET_MARKDOWN: can not read file: '
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method debug from undeclared class \Psr\Log\LoggerInterface
                          Open

                                              $this->log->debug('ROUTE: include '.$action);
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          Call to method error from undeclared class \Psr\Log\LoggerInterface
                          Open

                                      $this->log->error('GET_MARKDOWN: parse failed on file: '
                          Severity: Critical
                          Found in Attogram/Attogram.php by phan

                          TODO found
                          Open

                                  // TODO dev - $title input, and default to 1st line of file
                          Severity: Minor
                          Found in Attogram/Attogram.php by fixme

                          Avoid variables with short names like $md. Configured minimum length is 3.
                          Open

                                      $md = $dir.DIRECTORY_SEPARATOR.$d;
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ShortVariable

                          Since: 0.2

                          Detects when a field, local, or parameter has a very short name.

                          Example

                          class Something {
                              private $q = 15; // VIOLATION - Field
                              public static function main( array $as ) { // VIOLATION - Formal
                                  $r = 20 + $this->q; // VIOLATION - Local
                                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                      $r += $this->q;
                                  }
                              }
                          }

                          Source https://phpmd.org/rules/naming.html#shortvariable

                          Avoid variables with short names like $ff. Configured minimum length is 3.
                          Open

                                      $ff = $dir.DIRECTORY_SEPARATOR.$f;
                          Severity: Minor
                          Found in Attogram/Attogram.php by phpmd

                          ShortVariable

                          Since: 0.2

                          Detects when a field, local, or parameter has a very short name.

                          Example

                          class Something {
                              private $q = 15; // VIOLATION - Field
                              public static function main( array $as ) { // VIOLATION - Formal
                                  $r = 20 + $this->q; // VIOLATION - Local
                                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                      $r += $this->q;
                                  }
                              }
                          }

                          Source https://phpmd.org/rules/naming.html#shortvariable

                          There are no issues that match your filters.

                          Category
                          Status