giansalex/greenter

View on GitHub

Showing 65 of 97 total issues

Method load has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function load(ClassMetadata $metadata)
    {
        $metadata->addPropertyConstraints('tipoOperacion', [
            new Assert\NotBlank(),
        ]);
Severity: Major
Found in packages/validator/src/Validator/Loader/v21/InvoiceLoader.php - About 2 hrs to fix

    Method load has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function load(ClassMetadata $metadata)
        {
            $metadata->addPropertyConstraints('tipoDoc', [
                new Assert\NotBlank(),
                new Assert\Choice([
    Severity: Minor
    Found in packages/validator/src/Validator/Loader/InvoiceLoader.php - About 1 hr to fix

      Method load has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function load(ClassMetadata $metadata)
          {
              $metadata->addPropertyConstraints('tipoDoc', [
                  new Assert\NotBlank(),
              ]);
      Severity: Minor
      Found in packages/validator/src/Validator/Loader/v21/NoteLoader.php - About 1 hr to fix

        Method create has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function create(): ?DocumentInterface
            {
                $invoice = new Invoice();
                $invoice
                    ->setUblVersion('2.1')
        Severity: Minor
        Found in packages/data/src/Data/Generator/InvoiceDiscountStore.php - About 1 hr to fix

          Method create has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function create(): ?DocumentInterface
              {
                  $invoice = new Invoice();
                  $invoice
                      ->setUblVersion('2.1')
          Severity: Minor
          Found in packages/data/src/Data/Generator/InvoicePagoCreditoStore.php - About 1 hr to fix

            Method create has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function create(): ?DocumentInterface
                {
                    $note = new Note();
                    $note
                        ->setTipDocAfectado('01')
            Severity: Minor
            Found in packages/data/src/Data/Generator/NoteStore.php - About 1 hr to fix

              Method create has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function create(): ?DocumentInterface
                  {
                      $perception = new Perception();
                      $perception
                          ->setSerie('P001')
              Severity: Minor
              Found in packages/data/src/Data/Generator/PerceptionStore.php - About 1 hr to fix

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

                    private function loadTotals(Invoice $inv, DOMXPath $xpt, DOMNode $node = null)
                    {
                        if (empty($node)) {
                            return;
                        }
                Severity: Minor
                Found in packages/xml-parser/src/Xml/Parser/InvoiceParser.php - About 1 hr to fix

                  Method create has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function create(): ?DocumentInterface
                      {
                          $invoice = new Invoice();
                          $invoice
                              ->setUblVersion('2.1')
                  Severity: Minor
                  Found in packages/data/src/Data/Generator/BoletaStore.php - About 1 hr to fix

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

                        private function getDetails()
                        {
                            $xml = $this->reader;
                            $nodes = $xml->getNodes('sac:SUNATRetentionDocumentReference', $this->rootNode);
                    
                    
                    Severity: Minor
                    Found in packages/xml-parser/src/Xml/Parser/RetentionParser.php - About 1 hr to fix

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

                          private function getDetails()
                          {
                              $xml = $this->reader;
                              $nodes = $xml->getNodes('sac:SUNATPerceptionDocumentReference', $this->rootNode);
                      
                      
                      Severity: Minor
                      Found in packages/xml-parser/src/Xml/Parser/PerceptionParser.php - About 1 hr to fix

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

                            public function load(ClassMetadata $metadata)
                            {
                                $metadata->addPropertyConstraints('tipoDoc', [
                                    new Assert\NotBlank(),
                                    new Assert\Length(['max' => 2]),
                        Severity: Minor
                        Found in packages/validator/src/Validator/Loader/DespatchLoader.php - About 1 hr to fix

                          Method create has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function create(): ?DocumentInterface
                              {
                                  $retention = new Retention();
                                  $retention
                                      ->setSerie('R001')
                          Severity: Minor
                          Found in packages/data/src/Data/Generator/RetentionStore.php - About 1 hr to fix

                            Method load has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function load(ClassMetadata $metadata)
                                {
                                    $metadata->addPropertyConstraints('unidad', [
                                        new Assert\NotBlank(),
                                    ]);
                            Severity: Minor
                            Found in packages/validator/src/Validator/Loader/v21/SaleDetailLoader.php - About 1 hr to fix

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

                                  private function loadTotals(Note $inv, DOMNode $node = null)
                                  {
                                      if (empty($node)) {
                                          return;
                                      }
                              Severity: Minor
                              Found in packages/xml-parser/src/Xml/Parser/NoteParser.php - About 1 hr to fix

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

                                    public function load(ClassMetadata $metadata)
                                    {
                                        $metadata->addPropertyConstraints('serie', [
                                            new Assert\NotBlank(),
                                            new Assert\Length(['max' => 4]),
                                Severity: Minor
                                Found in packages/validator/src/Validator/Loader/RetentionLoader.php - About 1 hr to fix

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

                                      public function load(ClassMetadata $metadata)
                                      {
                                          $metadata->addPropertyConstraints('serie', [
                                              new Assert\NotBlank(),
                                              new Assert\Length(['max' => 4]),
                                  Severity: Minor
                                  Found in packages/validator/src/Validator/Loader/PerceptionLoader.php - About 1 hr to fix

                                    Function loadTotals has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        private function loadTotals(Invoice $inv, DOMXPath $xpt, DOMNode $node = null)
                                        {
                                            if (empty($node)) {
                                                return;
                                            }
                                    Severity: Minor
                                    Found in packages/xml-parser/src/Xml/Parser/InvoiceParser.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 processResponse has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function processResponse(StatusResponse $status): StatusResult
                                        {
                                            $code = $status->getCodRespuesta();
                                    
                                            $result = new StatusResult();
                                    Severity: Minor
                                    Found in packages/ws/src/Api/GreSender.php - About 1 hr to fix

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

                                          private function getShipment()
                                          {
                                              $xml = $this->reader;
                                              $node = $xml->getNode('cac:Shipment', $this->rootNode);
                                      
                                      
                                      Severity: Minor
                                      Found in packages/xml-parser/src/Xml/Parser/DespatchParser.php - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language