lib/modules/Forums/Models/Process.php
File Process.php
has 314 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
Process
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Process
{
/**
* @param String $action
*/
- Create a ticketCreate a ticket
Method startThread
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function startThread()
{
$threads = new Threads();
$posts = new Posts();
$category = Post::get('category');
- Create a ticketCreate a ticket
Method showData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function showData($type)
{
$data = false;
$cat = new Categories();
$view = new View();
- Create a ticketCreate a ticket
Function loadThreads
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private function loadThreads()
{
$res = false;
$threads = new Threads();
if (Post::get('id') !== null) {
- 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"