juniorb2ss/zServices

View on GitHub

Showing 11 of 19 total issues

Function scraping has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function scraping()
    {
        $scrapped = [];

        $this->hasError();
Severity: Minor
Found in src/ReceitaFederal/Services/Portais/AN/Crawler.php - About 2 hrs 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 scraping has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function scraping()
    {
        $scrapped = [];

        $this->hasError();
Severity: Minor
Found in src/Sintegra/Services/Portais/SP/Crawler.php - About 2 hrs 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 getCaptcha has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getCaptcha() {
        $this->hasRequested();

        $imageSrc = $this->instanceResponse->filter(
            array_get($this->configurations, 'selectors.image')
Severity: Minor
Found in src/Sintegra/Services/Portais/SP/Search.php - About 1 hr to fix

Method getData has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getData($document, $cookie, $captcha, $params, $configurations) {

        // resolve captcha
        $captcha = $this->resolveCaptcha($captcha);

Severity: Minor
Found in src/ReceitaFederal/Services/Portais/AN/Search.php - About 1 hr to fix

Method getData has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getData($document, $cookie, $captcha, $params, $configurations) {

        // resolve captcha
        $captcha = $this->resolveCaptcha($captcha);

Severity: Minor
Found in src/Sintegra/Services/Portais/SP/Search.php - About 1 hr to fix

Method getCaptcha has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getCaptcha() {
        $this->hasRequested();

        // Inicia instancia do cURL
        $curl = new Curl;
Severity: Minor
Found in src/ReceitaFederal/Services/Portais/AN/Search.php - About 1 hr to fix

Method request has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function request($method, $url, array $parameters = array(), array $files = array(), array $server = array(), $content = null, $changeHistory = true)
Severity: Major
Found in src/Miscellany/ClientHttp.php - About 50 mins to fix

Method getData has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function getData($document, $cookie, $captcha, $params, $configurations) {
Severity: Minor
Found in src/Sintegra/Services/Portais/SP/Search.php - About 35 mins to fix

Method getData has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function getData($document, $cookie, $captcha, $params, $configurations) {
Severity: Minor
Found in src/ReceitaFederal/Services/Portais/AN/Search.php - About 35 mins to fix

Method sintegra has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function sintegra($portal = 'SP', $document = false, $cookie = false, $captcha = false, $params = [])
Severity: Minor
Found in src/Helpers/Sintegra.php - About 35 mins to fix

Method getData has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function getData($document, $cookie, $captcha, $params, $configurations);
Severity: Minor
Found in src/Miscellany/Interfaces/SearchInterface.php - About 35 mins to fix
Severity
Category
Status
Source
Language