bjorn-87/anax-weathermodule

View on GitHub

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;
Severity: Major
Found in src/Weather/WeatherApiController.php - About 3 hrs to fix

    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;
    Severity: Minor
    Found in src/Weather/WeatherController.php - About 1 hr to fix

      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);
      Severity: Minor
      Found in src/GeoLocation/GeoApiController.php - About 1 hr to fix

        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;
        Severity: Minor
        Found in src/Weather/WeatherApiController.php - About 1 hr 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

        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 = [];
        
        
        Severity: Minor
        Found in src/Weather/Weather.php - About 1 hr 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

        Method indexActionPost has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function indexActionPost() : array
            {
                $valid = null;
                $type = null;
                $host = null;
        Severity: Minor
        Found in src/Validate/IpJsonController.php - About 1 hr to fix

          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 = [];
          
          
          Severity: Minor
          Found in src/Weather/Weather.php - About 1 hr to fix

            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");
            Severity: Minor
            Found in src/GeoLocation/GeoLocationController.php - About 1 hr to fix

              Function indexActionPost has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function indexActionPost() : array
                  {
                      $valid = null;
                      $type = null;
                      $host = null;
              Severity: Minor
              Found in src/Validate/IpJsonController.php - About 1 hr 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

              Method indexAction has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function indexAction() : object
                  {
                      $title = "Validate IP";
                      $valid = null;
                      $type = null;
              Severity: Minor
              Found in src/Validate/ValidateIpController.php - About 1 hr to fix

                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;
                Severity: Minor
                Found in src/Validate/ValidateIpController.php - About 1 hr 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

                Method multiCurlApi has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function multiCurlApi(array $urls) : array
                    {
                        $response = [];
                
                        if (count($urls) !== 0) {
                Severity: Minor
                Found in src/Curl/Curl.php - About 1 hr to fix

                  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;
                  Severity: Minor
                  Found in src/Weather/WeatherController.php - About 45 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

                  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) {
                  Severity: Minor
                  Found in src/Curl/Curl.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

                  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);
                  Severity: Minor
                  Found in src/GeoLocation/GeoApiController.php - About 25 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

                  Severity
                  Category
                  Status
                  Source
                  Language