WissamSawah/Weather

View on GitHub

Showing 84 of 84 total issues

Expected 0 spaces before opening brace; 1 found
Open

 {
Severity: Minor
Found in src/Weather/WeatherIp.php by phpcodesniffer

There must be one blank line after the namespace declaration
Open

namespace Aisa\Weather;
Severity: Minor
Found in src/Weather/JsonWeather.php by phpcodesniffer

There must be one blank line after the namespace declaration
Open

namespace Aisa\Weather;

There must be one blank line after the last USE statement; 0 found;
Open

use Anax\Commons\ContainerInjectableTrait;

There must be one blank line after the namespace declaration
Open

namespace Aisa\WeatherRequest;

Function multiCurlJson has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function multiCurlJson($details)
    {
        $accessKey  = $this->darkKey;
        $multiRequests = [];
        #future weather
Severity: Minor
Found in src/Weather/JsonWeather.php - About 35 mins to fix

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

There must be one blank line after the last USE statement; 0 found;
Open

use Anax\Commons\ContainerInjectableTrait;
Severity: Minor
Found in src/Weather/JsonWeather.php by phpcodesniffer

There must be one blank line after the namespace declaration
Open

namespace Aisa\Config;
Severity: Minor
Found in config/apiKeys.php by phpcodesniffer

Avoid unused local variables such as '$title'.
Open

        $title = "Check IP (JSON)";
Severity: Minor
Found in src/Weather/JsonWeather.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Avoid unused local variables such as '$key'.
Open

            foreach ($weather as $key => $value) {
Severity: Minor
Found in src/Weather/JsonWeather.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Avoid unused local variables such as '$key'.
Open

            foreach ($weather as $key => $value) {
Severity: Minor
Found in src/Weather/JsonWeather.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Avoid unused local variables such as '$title'.
Open

        $title = "Check IP (JSON)";
Severity: Minor
Found in src/Weather/JsonWeather.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Avoid unused local variables such as '$page'.
Open

        $page = $this->di->get("page");
Severity: Minor
Found in src/Weather/JsonWeather.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Avoid unused local variables such as '$page'.
Open

        $page = $this->di->get("page");
Severity: Minor
Found in src/Weather/JsonWeather.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Line exceeds 120 characters; contains 123 characters
Open

        "start" => "\n\n\n" . t("Revision history") . " {#revision}\n-------------\n\n<span class=\"revision-history\">\n",
Severity: Minor
Found in config/content.php by phpcodesniffer

Line exceeds 120 characters; contains 133 characters
Open

                $multiRequests[] = $BaseUrl.$accessKey .'/'.$details['latitude'].','.$details['longitude'].','.$unixTime.$apiSetting;
Severity: Minor
Found in src/Weather/JsonWeather.php by phpcodesniffer

Line exceeds 120 characters; contains 133 characters
Open

                $multiRequests[] = $BaseUrl.$accessKey .'/'.$details['latitude'].','.$details['longitude'].','.$unixTime.$apiSetting;
Severity: Minor
Found in src/Weather/JsonWeather.php by phpcodesniffer

Line exceeds 120 characters; contains 196 characters
Open

                $multiRequests[] = 'https://api.darksky.net/forecast/'.$accessKey .'/'.$details['latitude'].','.$details['longitude'].','.$unixTime.'?exclude=minutely,hourly,daily,flags&units=si';

Line exceeds 120 characters; contains 196 characters
Open

                $multiRequests[] = 'https://api.darksky.net/forecast/'.$accessKey .'/'.$details['latitude'].','.$details['longitude'].','.$unixTime.'?exclude=minutely,hourly,daily,flags&units=si';

Line indented incorrectly; expected 8 spaces, found 9
Open

         }
Severity: Minor
Found in src/Weather/WeatherIp.php by phpcodesniffer
Severity
Category
Status
Source
Language