attogram/attogram

View on GitHub

Showing 51 of 308 total issues

Method tabler has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $table,
        $tableId,
        $nameSingular,
        $namePlural,
        $publicLink,
Severity: Major
Found in Attogram/AttogramDatabaseInterface.php - About 1 hr to fix

    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

    Method tabler has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $table,
            $tableId,
            $nameSingular,
            $namePlural,
            $publicLink,
    Severity: Major
    Found in Attogram/NullDatabase.php - About 1 hr to fix

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

          public function tranquility()
          {
              // Speed things up! gz compession
              //if (ob_start('ob_gzhandler')) {
              //    $this->debug('tranquility: ob_gzhandler active');
      Severity: Minor
      Found in public/index.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 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

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

            public function apacheConfExamine($conf)
            {
                $thisDir = '';
                $allowOverride = array();
                $file = new SplFileObject($conf);
        Severity: Minor
        Found in public/check.php - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                  if ((isset($this->config['debug'])   // debug is true...
                      && is_bool($this->config['debug'])
                      && $this->config['debug'])
                      ||
                      ($request->query->has('debug')   // admin debug url override ?debug
          Severity: Major
          Found in public/index.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

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

                        $level,
                        $message,
                        $file = '',
                        $line = '',
                        $context = array()
                Severity: Minor
                Found in public/index.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 guruMeditationErrorHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function guruMeditationErrorHandler(
                          $level,
                          $message,
                          $file = '',
                          $line = '',
                  Severity: Minor
                  Found in public/index.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 checkIndex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function checkIndex()
                      {
                          $indexFile = './index.php';
                          file_exists($indexFile) ? $fileexists = 'pass' : $fileexists = 'fail';
                          echo '<pre class="'.$fileexists.'">'.$this->{$fileexists}.' 1.0 - <strong>'.$indexFile.'</strong> exists</pre>';
                  Severity: Minor
                  Found in public/check.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;
                  Severity: Major
                  Found in public/index.php - About 30 mins to fix

                    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;
                      Severity: Major
                      Found in public/index.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return;
                        Severity: Major
                        Found in public/index.php - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language