Showing 15 of 37 total issues
Method indexActionPost
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function indexActionPost() : array
{
$mapUrl = "https://www.openstreetmap.org/search?query=";
$lat = null;
$long = null;
Method indexActionGet
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function indexActionGet() : object
{
$title = "Weather";
$page = $this->di->get("page");
$lat = null;
Method indexActionPost
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function indexActionPost() : array
{
$ipAdr = $this->di->request->getPost("ip");
$mapUrl = "https://www.openstreetmap.org/search?query=";
$valid = $this->validateIp->validate($ipAdr);
Function indexActionPost
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function indexActionPost() : array
{
$mapUrl = "https://www.openstreetmap.org/search?query=";
$lat = null;
$long = null;
- 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 getData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getData(array $weather, string $option = "daily")
{
$count = count($weather);
$selected = [];
- 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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function indexActionPost() : array
{
$valid = null;
$type = null;
$host = null;
Method getData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getData(array $weather, string $option = "daily")
{
$count = count($weather);
$selected = [];
Method indexActionGet
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function indexActionGet() : object
{
$title = "Geolocation";
$page = $this->di->get("page");
$ipAdr = $this->di->request->getGet("ip");
Function indexActionPost
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function indexActionPost() : array
{
$valid = null;
$type = null;
$host = null;
- 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 indexAction
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function indexAction() : object
{
$title = "Validate IP";
$valid = null;
$type = null;
Function indexAction
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function indexAction() : object
{
$title = "Validate IP";
$valid = null;
$type = null;
- 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 multiCurlApi
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function multiCurlApi(array $urls) : array
{
$response = [];
if (count($urls) !== 0) {
Function indexActionGet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function indexActionGet() : object
{
$title = "Weather";
$page = $this->di->get("page");
$lat = null;
- 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 multiCurlApi
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function multiCurlApi(array $urls) : array
{
$response = [];
if (count($urls) !== 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
Function indexActionPost
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function indexActionPost() : array
{
$ipAdr = $this->di->request->getPost("ip");
$mapUrl = "https://www.openstreetmap.org/search?query=";
$valid = $this->validateIp->validate($ipAdr);
- 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"