Showing 24 of 26 total issues
Function uploadImg
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function uploadImg($type = null, $id = null, $action = null)
{
$accepted_origins = array("http://localhost:3000", "http://82.64.201.160", "http://recette.thomas-claireau.fr", "https://recette.thomas-claireau.fr");
$type = $type == null ? $this->inputGet('type') : $type;
- 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 exports
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (options) => {
const { dev } = options;
const hmr = HMR.getClient();
return {
Method uploadImg
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function uploadImg($type = null, $id = null, $action = null)
{
$accepted_origins = array("http://localhost:3000", "http://82.64.201.160", "http://recette.thomas-claireau.fr", "https://recette.thomas-claireau.fr");
$type = $type == null ? $this->inputGet('type') : $type;
Function checkAllInput
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function checkAllInput($context)
{
$post = MainController::getData();
if ($context == 'contact') {
- 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 updateAccount
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function updateAccount()
{
// session_start();
$outputData = $this->data;
- 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 sendEmail
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendEmail()
{
require_once 'setup/configMail.php';
$serveurName = $configMail['smtp'];
$port = $configMail['port'];
Function defaultMethod
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function defaultMethod()
{
$action = $this->inputGet('action');
$type = $this->inputGet('type');
- 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 addAccount
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addAccount()
{
require_once 'setup/configMail.php';
$serveurName = $configMail['smtp'];
$port = $configMail['port'];
Method sendForgotPassword
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendForgotPassword()
{
require_once 'setup/configMail.php';
$serveurName = $configMail['smtp'];
$port = $configMail['port'];
Method defaultMethod
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function defaultMethod()
{
$action = $this->inputGet('action');
$type = $this->inputGet('type');
Function inputPost
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function inputPost($key = false, $isArray = true)
{
if (!$isArray && $key) {
$post = filter_input(INPUT_POST, $key);
switch ($key) {
- 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 checkAllInput
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkAllInput($context)
{
$post = MainController::getData();
if ($context == 'contact') {
Function getPost
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getPost(array $key = null)
{
if (isset($key) && !empty($key)) {
$posts = ModelFactory::getModel('Post')->listData($key[key($key)], key($key));
- 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 inputPost
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function inputPost($key = false, $isArray = true)
{
if (!$isArray && $key) {
$post = filter_input(INPUT_POST, $key);
switch ($key) {
Method updateAccount
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateAccount()
{
// session_start();
$outputData = $this->data;
Function getServerIP
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function getServerIP()
{
$adresse = '';
$server = filter_input_array(INPUT_SERVER);
- 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 exports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (options) => {
const { dev } = options;
const hmr = HMR.getClient();
return {
- 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 listData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function listData(string $value = null, string $key = null, array $params = null)
{
if (isset($key)) {
$query = 'SELECT * FROM ' . $this->table . ' WHERE ' . $key . ' = ?';
- 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
Avoid too many return
statements within this method. Open
return $post;
Avoid too many return
statements within this method. Open
return filter_input_array(INPUT_POST);