Showing 19 of 129 total issues
File all.php
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// This is /music-bin/
if( !defined('CHECK') )
header( 'Location: '.APPURL.'music-bin/' );
File home.php
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
if( !defined('CHECK') )
header( 'Location: '.APPURL );
error_reporting(E_ALL);
Function is_serialized
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function is_serialized( $data, $strict = true ) {
// if it isn't a string, it isn't serialized.
if ( ! is_string( $data ) ) {
return false;
}
- 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 create_database
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function create_database() {
try
{
$this->exec('
CREATE TABLE IF NOT EXISTS albums (
Method is_serialized
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function is_serialized( $data, $strict = true ) {
// if it isn't a string, it isn't serialized.
if ( ! is_string( $data ) ) {
return false;
}
Function play_later
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
play_later: function () {
var working = false;
$('.play-later').click(function(event) {
event.preventDefault();
if( working ) {
Avoid deeply nested control flow statements. Open
if( !is_array( $last_tags ) ) {
$last_tags = array();
}
Avoid deeply nested control flow statements. Open
if( !is_array( $genres ) ) {
$genres = array();
}
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return (bool) preg_match( "/^{$token}:[0-9.E-]+;$end/", $data );
Avoid too many return
statements within this method. Open
return (bool) preg_match( "/^{$token}:[0-9]+:/s", $data );
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Function get_playlist
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function get_playlist( $me, $api, $offset = 0 ) {
$new_all_user_playlists = array();
$all_user_playlists_playlists = $api->getUserPlaylists( $me->id, array( 'offset' => $offset ) );
$total = $all_user_playlists_playlists->total;
$total_pages = $total / 20;
- 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 get_playlist
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function get_playlist( $me, $api, $offset = 0 ) {
$new_all_user_playlists = array();
$all_user_playlists_playlists = $api->getUserPlaylists( $me->id, array( 'offset' => $offset ) );
$total = $all_user_playlists_playlists->total;
$total_pages = $total / 20;
- 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"