Passed
Push — master ( 694e2f...150a8e )
by Dean
09:10 queued 06:18
created

ApiOption   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
dl 0
loc 22
ccs 10
cts 14
cp 0.7143
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A value() 0 8 2
1 1
from plugin.core.environment import translate as _
0 ignored issues
show
Bug introduced by
The name environment does not seem to exist in module plugin.core.
Loading history...
Configuration introduced by
Unable to import 'plugin.core.environment' (invalid syntax (<string>, line 101))

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 plugin.preferences.options.core.base import SimpleOption
3
4 1
import logging
5
6 1
log = logging.getLogger(__name__)
7
8
9 1
class ApiOption(SimpleOption):
0 ignored issues
show
Bug introduced by
The method on_plex_changed which was declared abstract in the super-class Option
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
10 1
    key = 'api.enabled'
11 1
    type = 'boolean'
12
13 1
    default = None
14 1
    scope = 'server'
15
16 1
    group = (_('API'),)
17 1
    label = _('Enabled')
18 1
    description = _(
19
        "Enables the plugin administration API, disabling this option will block access to the configuration site."
20
    )
21 1
    order = 200
22
23 1
    @property
24
    def value(self):
25
        value = super(ApiOption, self).value
26
27
        if value is None:
28
            return True
29
30
        return value
31