trocafone    /
                    correios-lib
                
                            | Conditions | 1 | 
| Total Lines | 8 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 2 | 
| CRAP Score | 1 | 
| Changes | 0 | ||
| Metric | Value | 
|---|---|
| cc | 1 | 
| dl | 0 | 
| loc | 8 | 
| ccs | 2 | 
| cts | 2 | 
| cp | 1 | 
| crap | 1 | 
| rs | 9.4285 | 
| c | 0 | 
| b | 0 | 
| f | 0 | 
| 1 | # -*- coding: utf-8 -*-  | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 2 | # #############################################################################  | 
            ||
| 3 | #  | 
            ||
| 4 | # The MIT License (MIT)  | 
            ||
| 5 | #  | 
            ||
| 6 | # Copyright (c) 2016 Trocafone  | 
            ||
| 7 | #  | 
            ||
| 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy  | 
            ||
| 9 | # of this software and associated documentation files (the "Software"), to deal  | 
            ||
| 10 | # in the Software without restriction, including without limitation the rights  | 
            ||
| 11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell  | 
            ||
| 12 | # copies of the Software, and to permit persons to whom the Software is  | 
            ||
| 13 | # furnished to do so, subject to the following conditions:  | 
            ||
| 14 | #  | 
            ||
| 15 | # The above copyright notice and this permission notice shall be included in  | 
            ||
| 16 | # all copies or substantial portions of the Software.  | 
            ||
| 17 | #  | 
            ||
| 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  | 
            ||
| 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  | 
            ||
| 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  | 
            ||
| 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  | 
            ||
| 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  | 
            ||
| 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  | 
            ||
| 24 | # SOFTWARE.  | 
            ||
| 25 | #  | 
            ||
| 26 | ###############################################################################  | 
            ||
| 27 | |||
| 28 | 1 | from correios_lib.base import EntityBase  | 
            |
| 29 | 1 | from correios_lib.validators import CEP, Email, Date  | 
            |
| 30 | 1 | from voluptuous import *  | 
            |
| 
                                                                                                                                                        
                         1 ignored issue 
                            –
                            show
                        The import  
                    
                                            voluptuous could not be resolved.
                                                                                                This can be caused by one of the following: 1. Missing DependenciesThis error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands. # .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
 Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use
the command for the correct version. 
2. Missing __init__.py filesThis error could also result from missing    Loading history...
                 | 
                |||
| 31 | |||
| 32 | |||
| 33 | 1 | class Destinatario(EntityBase):  | 
            |
| 34 | ''' Reference to wsdl: '''  | 
            ||
| 35 | |||
| 36 | 1 | def get_schema(self):  | 
            |
| 37 | 1 |         return Schema({ | 
            |
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 38 |             Required('nome'): All(Coerce(str), Length(max=60)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 39 |             Required('logradouro'): All(Coerce(str), Length(max=72)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 40 |             Required('numero'): All(Coerce(str), Length(max=8)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 41 |             Optional('complemento'): All(Coerce(str), Length(max=30)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 42 |             Required('bairro'): All(Coerce(str), Length(max=50)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 43 |             Optional('referencia'): All(Coerce(str), Length(max=60)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 44 |             Required('cidade'): All(Coerce(str), Length(max=36)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 45 |             Required('uf'): All(Coerce(str), Length(min=2, max=2)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 46 |             Required('cep'): All(CEP, Length(min=8, max=9)), | 
            ||
| 
                                                                                                                                                                                                            
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 47 |             Optional('ddd'): All(Coerce(str), Length(min=2, max=2)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 48 |             Optional('telefone'): All(Coerce(str), Length(min=8, max=12)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 49 |             Optional('email'): All(Email, Length(max=72)) | 
            ||
| 
                                                                                                                                                                                                            
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 50 | }, extra=REMOVE_EXTRA)  | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 51 | |||
| 52 | |||
| 53 | 1 | class Coleta(EntityBase):  | 
            |
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                        This class should have a docstring.
                                                                                                 
                    
                                            The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
    def some_method(self):
        """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.   Loading history...
                 | 
                |||
| 54 | |||
| 55 | 1 | def get_schema(self):  | 
            |
| 56 | 1 |         return Schema({ | 
            |
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 57 |             Required('tipo'): Any('CA', 'C', 'A'), | 
            ||
| 
                                                                                                                                                        
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 58 |             Optional('numero'): Coerce(int), | 
            ||
| 
                                                                                                                                                        
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 59 |             Optional('id_cliente'): All(Length(max=30)), | 
            ||
| 
                                                                                                                                                                                                            
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 60 |             Optional('ag'): Date, | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 61 |             Optional('cartao'): Coerce(str), | 
            ||
| 
                                                                                                                                                        
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 62 |             Optional('valor_declarado'): float, | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 63 |             Optional('servico_adicional'): All(Coerce(str), Length(max=20)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 64 |             Optional('descricao'): All(Coerce(str), Length(max=255)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 65 |             Optional('ar'): Coerce(bool), | 
            ||
| 
                                                                                                                                                        
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 66 |             Optional('cklist'): Any(2, 4, 5, 7), | 
            ||
| 
                                                                                                                                                        
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 67 |             Optional('documento'): [str], | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 68 |             Required('remetente'): Remetente, | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 69 |             Optional('obj_col'): [Objeto], | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 70 |             Optional('produto'): Produto | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 71 | }, extra=REMOVE_EXTRA)  | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 72 | |||
| 73 | |||
| 74 | 1 | class Objeto(EntityBase):  | 
            |
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                        This class should have a docstring.
                                                                                                 
                    
                                            The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
    def some_method(self):
        """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.   Loading history...
                 | 
                |||
| 75 | |||
| 76 | 1 | def get_schema(self):  | 
            |
| 77 | 1 |         return Schema({ | 
            |
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 78 |             Required('item'): 1, | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 79 |             Optional('id'): All(Coerce(str), Length(max=30)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 80 |             Optional('desc'): All(Coerce(str), Length(max=255)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 81 |             Optional('entrega'): All(Coerce(str), Length(max=13)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 82 |             Optional('num'): All(Coerce(str), Length(max=13)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 83 | }, extra=REMOVE_EXTRA)  | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 84 | |||
| 85 | |||
| 86 | 1 | class Produto(EntityBase):  | 
            |
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                        This class should have a docstring.
                                                                                                 
                    
                                            The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
    def some_method(self):
        """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.   Loading history...
                 | 
                |||
| 87 | |||
| 88 | 1 | def get_schema(self):  | 
            |
| 89 | 1 |         return Schema({ | 
            |
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 90 |             Optional('codigo'): Coerce(int), | 
            ||
| 
                                                                                                                                                        
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 91 |             Optional('tipo'): Coerce(int), | 
            ||
| 
                                                                                                                                                        
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 92 |             Optional('qtd'): Coerce(int) | 
            ||
| 
                                                                                                                                                        
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 93 | }, extra=REMOVE_EXTRA)  | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 94 | |||
| 95 | |||
| 96 | 1 | class Remetente(EntityBase):  | 
            |
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                        This class should have a docstring.
                                                                                                 
                    
                                            The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
    def some_method(self):
        """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.   Loading history...
                 | 
                |||
| 97 | |||
| 98 | 1 | def get_schema(self):  | 
            |
| 99 | 1 |         return Schema({ | 
            |
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 100 |             Required('nome'): All(Coerce(str), Length(max=60)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 101 |             Required('logradouro'): All(Coerce(str), Length(max=72)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 102 |             Required('numero'): All(Coerce(str), Length(max=8)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 103 |             Optional('complemento'): All(Coerce(str), Length(max=30)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 104 |             Required('bairro'): All(Coerce(str), Length(max=50)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 105 |             Optional('referencia'): All(Coerce(str), Length(max=60)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 106 |             Required('cidade'): All(Coerce(str), Length(max=36)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 107 |             Required('uf'): All(Coerce(str), Length(min=2, max=2)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 108 |             Required('cep'): All(CEP, Length(min=8, max=9)), | 
            ||
| 
                                                                                                                                                                                                            
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 109 |             Required('ddd'): All(Coerce(str), Length(min=2, max=2)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 110 |             Required('telefone'): All(Coerce(str), Length(min=8, max=12)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 111 |             Required('email'): All(Email, Length(max=72)), | 
            ||
| 
                                                                                                                                                                                                            
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 112 |             Optional('celular'): All(Coerce(str), Length(max=9)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 113 |             Optional('ddd_celular'): All(Coerce(str), Length(max=3)), | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 114 |             Optional('sms'): Any('S', 'N'), | 
            ||
| 
                                                                                                                                                        
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 115 |             Optional('identificacao'): All(Coerce(str), Length(max=14)) | 
            ||
| 
                                                                                                                                                                                                                                                                
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 116 | }, extra=REMOVE_EXTRA)  | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                         | 
                |||
| 117 | 
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.