giansalex/greenter

View on GitHub

Showing 97 of 97 total issues

Receipt has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class Receipt implements DocumentInterface
{
    /**
     * Persona natural que emite el recibo.
     *
Severity: Minor
Found in packages/core/src/Core/Model/Sale/Receipt.php - About 2 hrs to fix

    Retention has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Retention implements DocumentInterface
    {
        /**
         * Serie del Documento (ejem: R001).
         *
    Severity: Minor
    Found in packages/core/src/Core/Model/Retention/Retention.php - About 2 hrs to fix

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

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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            private function getClient(DOMXPath $xp)
            {
                $node = $xp->query('/xt:Invoice/cac:AccountingCustomerParty')->item(0);
        
                $cl = new Client();
        Severity: Major
        Found in packages/xml-parser/src/Xml/Parser/InvoiceParser.php and 1 other location - About 2 hrs to fix
        packages/xml-parser/src/Xml/Parser/InvoiceParser.php on lines 217..228

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 125.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            private function getCompany(DOMXPath $xp)
            {
                $node = $xp->query('/xt:Invoice/cac:AccountingSupplierParty')->item(0);
        
                $cl = new Company();
        Severity: Major
        Found in packages/xml-parser/src/Xml/Parser/InvoiceParser.php and 1 other location - About 2 hrs to fix
        packages/xml-parser/src/Xml/Parser/InvoiceParser.php on lines 204..215

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 125.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

            public function create(): ?DocumentInterface
            {
                $baja = new Document();
                $baja->setTipoDoc('09')
                    ->setNroDoc('T001-00001');
        Severity: Major
        Found in packages/data/src/Data/Generator/DespatchStore.php - About 2 hrs to fix

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

              public function create(): ?DocumentInterface
              {
          
                  $invoice = new Invoice();
                  $invoice
          Severity: Major
          Found in packages/data/src/Data/Generator/InvoiceIvapStore.php - About 2 hrs to fix

            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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language