Showing 51 of 308 total issues
File Attogram.php
has 680 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// Attogram Framework - Attogram class v0.5.6
namespace Attogram;
Function checkHtaccess
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
public function checkHtaccess()
{
$htaccessFile = './.htaccess';
file_exists($htaccessFile) ? $result = 'pass' : $result = 'fail';
echo '<pre class="'.$result.'">'.$this->{$result}.' 2.0 - <strong>'
- Read upRead up
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 checkHtaccess
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkHtaccess()
{
$htaccessFile = './.htaccess';
file_exists($htaccessFile) ? $result = 'pass' : $result = 'fail';
echo '<pre class="'.$result.'">'.$this->{$result}.' 2.0 - <strong>'
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
File check.php
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// Attogram Framework - Check Script v0.1.11
namespace Attogram;
File index.php
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// Attogram Framework - Guru Meditation Loader - v0.6.0
namespace Attogram;
Method guruMeditationErrorHandler
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function guruMeditationErrorHandler(
$level,
$message,
$file = '',
$line = '',
Method awaken
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function awaken()
{
// The Site Administrator IP addresses
$this->remember(
'admins',
Method checkApache
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkApache()
{
isset($_SERVER['SERVER_SOFTWARE'])
? $serverSoftware = $_SERVER['SERVER_SOFTWARE'] : $serverSoftware = '';
$serverSoftwareArray = explode(' ', $serverSoftware);
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':
- Read upRead up
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':
Method tranquility
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function tranquility()
{
// Speed things up! gz compession
//if (ob_start('ob_gzhandler')) {
// $this->debug('tranquility: ob_gzhandler active');
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');
Function apacheConfExamine
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function apacheConfExamine($conf)
{
$thisDir = '';
$allowOverride = array();
$file = new SplFileObject($conf);
- Read upRead up
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 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">'
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
}
- Read upRead up
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');
- Read upRead up
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
}
Method meditate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function meditate()
{
// Set default configuration
$this->config = array();
$this->config['attogramDirectory'] = '..'.DIRECTORY_SEPARATOR;
Method testNullDatabase
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testNullDatabase()
{
$nullDatabase = new \Attogram\NullDatabase;
$this->assertFalse(
$nullDatabase->initDB(),