Showing 8 of 8 total issues
Function getResultPast
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getResultPast($info, $result, $dates)
{
if ($info == "all") {
$sum = [];
$count = 0;
- 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 indexActionPost
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function indexActionPost(): object
{
$title = "Kolla ip";
$request = $this->di->request;
Method indexActionPost
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function indexActionPost(): object
{
$title = "Kolla ip";
$request = $this->di->request;
Method getWeather
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getWeather($latitude, $longitude, $period)
{
// Set API access key
$accessKey = require(ANAX_INSTALL_PATH . "/config/api_key.php");
Method getResultPast
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getResultPast($info, $result, $dates)
{
if ($info == "all") {
$sum = [];
$count = 0;
Function getResultToCome
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getResultToCome($info, $result)
{
if ($info == "all") {
$sum = $result;
} elseif ($info == "currently") {
- 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 indexActionPost
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function indexActionPost(): object
{
$title = "Kolla ip";
$request = $this->di->request;
- 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 indexActionPost
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function indexActionPost(): object
{
$title = "Kolla ip";
$request = $this->di->request;
- 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"