lib/modules/Core/View/View.php
File View.php
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* ########################################################################################
* ## CUNITY(R) V2.0 - An open source social network / "your private social network" ##
- Create a ticketCreate a ticket
Method show
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function show()
{
if (Login::loggedIn() && Get::get('m') !== 'admin') {
$this->registerScript('search', 'livesearch');
$this->registerScript('messages', 'message-modal');
- Create a ticketCreate a ticket
Method initTranslator
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function initTranslator()
{
Cunity::init();
$locale = new Zend_Locale(Cunity::get('settings')->getSetting('core.language'));
- Create a ticketCreate a ticket
Function registerCunityPlugin
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function registerCunityPlugin($pluginName, array $files)
{
if (file_exists('plugins/'.$pluginName)) {
if (!empty($files)) {
foreach ($files as $file) {
- 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 registerScript
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function registerScript($module, $scriptName)
{
if ((!empty($module))) {
$module = ucfirst($module).'/styles/javascript/';
} else {
- Create a ticketCreate a ticket
Function show
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public function show()
{
if (Login::loggedIn() && Get::get('m') !== 'admin') {
$this->registerScript('search', 'livesearch');
$this->registerScript('messages', 'message-modal');
- 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"