GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( cc6b42...7d41d1 )
by Flávio
01:26 queued 01:22
created

Destinatario   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 18
rs 10
ccs 3
cts 3
cp 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_schema() 0 15 1
1
# -*- coding: utf-8 -*-
0 ignored issues
show
Coding Style introduced by
This module 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...
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
Configuration introduced by
The import voluptuous could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This 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 files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
Coding Style introduced by
The usage of wildcard imports like voluptuous should generally be avoided.
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
Comprehensibility Best Practice introduced by
Undefined variable 'Schema'
Loading history...
38
            Required('nome'): All(Coerce(str), Length(max=60)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
39
            Required('logradouro'): All(Coerce(str), Length(max=72)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
40
            Required('numero'): All(Coerce(str), Length(max=8)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
41
            Optional('complemento'): All(Coerce(str), Length(max=30)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
42
            Required('bairro'): All(Coerce(str), Length(max=50)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
43
            Optional('referencia'): All(Coerce(str), Length(max=60)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
44
            Required('cidade'): All(Coerce(str), Length(max=36)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
45
            Required('uf'): All(Coerce(str), Length(min=2, max=2)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
46
            Required('cep'): All(CEP, Length(min=8, max=9)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
47
            Optional('ddd'): All(Coerce(str), Length(min=2, max=2)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
48
            Optional('telefone'): All(Coerce(str), Length(min=8, max=12)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
49
            Optional('email'): All(Email, Length(max=72))
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
50
        }, extra=REMOVE_EXTRA)
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'REMOVE_EXTRA'
Loading history...
51
52
53 1
class Coleta(EntityBase):
0 ignored issues
show
Coding Style introduced by
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
Comprehensibility Best Practice introduced by
Undefined variable 'Schema'
Loading history...
57
            Required('tipo'): Any('CA', 'C', 'A'),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Any'
Loading history...
58
            Optional('numero'): Coerce(int),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
59
            Optional('id_cliente'): All(Length(max=30)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
60
            Optional('ag'): Date,
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
61
            Optional('cartao'): Coerce(str),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
62
            Optional('valor_declarado'): float,
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
63
            Optional('servico_adicional'): All(Coerce(str), Length(max=20)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
64
            Optional('descricao'): All(Coerce(str), Length(max=255)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
65
            Optional('ar'): Coerce(bool),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
66
            Optional('cklist'): Any(2, 4, 5, 7),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Any'
Loading history...
67
            Optional('documento'): [str],
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
68
            Required('remetente'): Remetente,
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
69
            Optional('obj_col'): [Objeto],
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
70
            Optional('produto'): Produto
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
71
        }, extra=REMOVE_EXTRA)
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'REMOVE_EXTRA'
Loading history...
72
73
74 1
class Objeto(EntityBase):
0 ignored issues
show
Coding Style introduced by
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
Comprehensibility Best Practice introduced by
Undefined variable 'Schema'
Loading history...
78
            Required('item'): 1,
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
79
            Optional('id'): All(Coerce(str), Length(max=30)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
80
            Optional('desc'): All(Coerce(str), Length(max=255)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
81
            Optional('entrega'): All(Coerce(str), Length(max=13)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
82
            Optional('num'): All(Coerce(str), Length(max=13)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
83
        }, extra=REMOVE_EXTRA)
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'REMOVE_EXTRA'
Loading history...
84
85
86 1
class Produto(EntityBase):
0 ignored issues
show
Coding Style introduced by
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
Comprehensibility Best Practice introduced by
Undefined variable 'Schema'
Loading history...
90
            Optional('codigo'): Coerce(int),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
91
            Optional('tipo'): Coerce(int),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
92
            Optional('qtd'): Coerce(int)
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
93
        }, extra=REMOVE_EXTRA)
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'REMOVE_EXTRA'
Loading history...
94
95
96 1
class Remetente(EntityBase):
0 ignored issues
show
Coding Style introduced by
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
Comprehensibility Best Practice introduced by
Undefined variable 'Schema'
Loading history...
100
            Required('nome'): All(Coerce(str), Length(max=60)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
101
            Required('logradouro'): All(Coerce(str), Length(max=72)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
102
            Required('numero'): All(Coerce(str), Length(max=8)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
103
            Optional('complemento'): All(Coerce(str), Length(max=30)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
104
            Required('bairro'): All(Coerce(str), Length(max=50)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
105
            Optional('referencia'): All(Coerce(str), Length(max=60)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
106
            Required('cidade'): All(Coerce(str), Length(max=36)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
107
            Required('uf'): All(Coerce(str), Length(min=2, max=2)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
108
            Required('cep'): All(CEP, Length(min=8, max=9)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
109
            Required('ddd'): All(Coerce(str), Length(min=2, max=2)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
110
            Required('telefone'): All(Coerce(str), Length(min=8, max=12)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
111
            Required('email'): All(Email, Length(max=72)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Required'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
112
            Optional('celular'): All(Coerce(str), Length(max=9)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
113
            Optional('ddd_celular'): All(Coerce(str), Length(max=3)),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
114
            Optional('sms'): Any('S', 'N'),
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Any'
Loading history...
115
            Optional('identificacao'): All(Coerce(str), Length(max=14))
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'Optional'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'All'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Coerce'
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'Length'
Loading history...
116
        }, extra=REMOVE_EXTRA)
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'REMOVE_EXTRA'
Loading history...
117