Showing 9 of 14 total issues
Function createUserMethod
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function createUserMethod()
{
if (!$this->isLogged()) {
if(null !== $this->getPost() && $this->checkArray($this->getPost())) {
- 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 createUserMethod
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createUserMethod()
{
if (!$this->isLogged()) {
if(null !== $this->getPost() && $this->checkArray($this->getPost())) {
Method defaultMethod
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function defaultMethod()
{
if($this->checkArray($this->getPost())){
$data = [
Function checkArrayElement
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function checkArrayElement(array $array, string $key, string $value)
{
if (!empty($array)) {
foreach ($array as $user) {
- 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 defaultMethod
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function defaultMethod()
{
if(null !== $this->getPost() && !empty($this->getPost())) {
$data = $this->getPost();
$user = ModelFactory::getModel("User")->readData((string) $data["email"], "email");
- 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 checkArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function checkArray(array $array)
{
if(!empty($array)) {
foreach ($array as $key => $value) {
- 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 updatePasswordMethod
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function updatePasswordMethod()
{
if($this->isLogged()){
if(null !== $this->getPost() && $this->checkArray($this->getPost())) {
- 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 getUser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getUser($id = null)
{
$user= [];
if (isset($id) && !empty($id)) {
$user = ModelFactory::getModel("User")->readData((string)$id);
- 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 updateUserMethod
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function updateUserMethod()
{
if($this->isLogged()){
if(null !== $this->getPost() && $this->checkArray($this->getPost())) {
- 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"