File ManageComments.php
has 597 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use COREPOS\Fannie\API\data\pipes\OutgoingEmail;
include(__DIR__ . '/../../../config.php');
Method get_id_view
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_id_view()
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$prefix = $settings['CommentDB'] . $this->connection->sep();
Method get_view
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_view()
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$prefix = $settings['CommentDB'] . $this->connection->sep();
Method post_new_handler
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_new_handler()
{
$uid = FannieAuth::getUID();
$cardno = trim(FormLib::get('cardno'));
$name = trim(FormLib::get('name'));
Method get_new_view
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_new_view()
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$categories = new CategoriesModel($this->connection);
$categories->whichDB($settings['CommentDB']);
Method post_id_handler
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_id_handler()
{
$uid = FannieAuth::getUID();
$settings = $this->config->get('PLUGIN_SETTINGS');
$this->connection->selectDB($settings['CommentDB']);
Function get_view
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function get_view()
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$prefix = $settings['CommentDB'] . $this->connection->sep();
- 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 post_id_catID_handler
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_id_catID_handler()
{
$uid = FannieAuth::getUID();
$settings = $this->config->get('PLUGIN_SETTINGS');
$this->connection->selectDB($settings['CommentDB']);
Method post_id_tags_handler
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_id_tags_handler()
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$this->connection->selectDB($settings['CommentDB']);
$tags = trim($this->tags);
Function post_new_handler
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function post_new_handler()
{
$uid = FannieAuth::getUID();
$cardno = trim(FormLib::get('cardno'));
$name = trim(FormLib::get('name'));
- 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_id_view
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function get_id_view()
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$prefix = $settings['CommentDB'] . $this->connection->sep();
- 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 post_id_tags_handler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function post_id_tags_handler()
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$this->connection->selectDB($settings['CommentDB']);
$tags = trim($this->tags);
- 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 post_id_handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function post_id_handler()
{
$uid = FannieAuth::getUID();
$settings = $this->config->get('PLUGIN_SETTINGS');
$this->connection->selectDB($settings['CommentDB']);
- 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"