File createfakestudents.php
has 1048 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/php
<?php
/**
* @license http://opensource.org/licenses/lgpl-3.0.html
* @author Matthew McNaney <mcnaney at gmail dot com>
- Create a ticketCreate a ticket
Method first_name
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
function first_name()
{
static $first_names = array(
'Abigail',
'Abigail',
- Create a ticketCreate a ticket
Method last_name
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
function last_name()
{
static $last_names = array(
'Acula',
'Achenbach',
- Create a ticketCreate a ticket
Method nickname
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
function nickname($first_name)
{
$shortened = array(
'Abigail' => 'Abby',
'Alexander' => 'Alex',
- Create a ticketCreate a ticket
Function process
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
function process($arguments)
{
$dump_data = false;
$term = get_term_default();
- Read upRead up
- Create a ticketCreate a ticket
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 process
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function process($arguments)
{
$dump_data = false;
$term = get_term_default();
- Create a ticketCreate a ticket
Method road
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function road()
{
$roads = array(
'Elm',
'Cactus',
- Create a ticketCreate a ticket
Method create_autocomplete_query
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create_autocomplete_query($row)
{
extract($row);
$lfirst = strtolower($first_name);
- Create a ticketCreate a ticket
Method reset_tables
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function reset_tables()
{
$pdo = get_connection();
echo 'Dropping ' . TABLE_NAME . " table.\n";
$pdo->exec('drop table if exists ' . TABLE_NAME);
- Create a ticketCreate a ticket
Method get_row
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_row($application_term)
{
$first_name = first_name();
$middle_name = middle_name($first_name);
$last_name = last_name();
- Create a ticketCreate a ticket
Method dsn_array
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dsn_array()
{
static $dsn_array = null;
if (!empty($dsn_array)) {
- Create a ticketCreate a ticket
Method student_type
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function student_type($student_level)
{
if ($student_level == 'G') {
return 'G';
}
- Create a ticketCreate a ticket
Method create_new_table
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create_new_table($pdo)
{
$table_name = TABLE_NAME;
$query = <<<EOF
CREATE TABLE $table_name (
- Create a ticketCreate a ticket
Function student_type
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function student_type($student_level)
{
if ($student_level == 'G') {
return 'G';
}
- Read upRead up
- Create a ticketCreate a ticket
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 middle_name
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function middle_name($first_name)
{
if (mt_rand(1, 100) == 1) {
return 'Danger';
} else {
- Read upRead up
- Create a ticketCreate a ticket
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 dsn_array
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function dsn_array()
{
static $dsn_array = null;
if (!empty($dsn_array)) {
- Read upRead up
- Create a ticketCreate a ticket
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"