Passed
Push — master ( bf9013...8b08e5 )
by Swen
02:02
created

LocalizedModel.__init__()   B

Complexity

Conditions 5

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 5

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 5
c 2
b 0
f 0
dl 0
loc 22
rs 8.3411
ccs 11
cts 11
cp 1
crap 5
1 1
from django.db import models
0 ignored issues
show
Configuration introduced by
The import django.db 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...
2 1
from django.core.checks import Warning
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in Warning.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
Configuration introduced by
The import django.core.checks 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...
3
4
5 1
class LocalizedModel(models.Model):
0 ignored issues
show
Coding Style introduced by
This class has no __init__ method.
Loading history...
6
    """A model keeped for backwards compatibility"""
7
8 1
    @classmethod
9
    def check(cls, **kwargs):
10
        errors = super().check(**kwargs)
11
        errors.append(
12
            Warning(
13
                'localized_fields.LocalizedModel is deprecated',
14
                hint='There is no need to use localized_fields.LocalizedModel',
15
                obj=cls
16
            )
17
        )
18
        return errors
19
20 1
    class Meta:
21
        abstract = True
22