Passed
Push — master ( 5dcfeb...4ecef7 )
by Steffen
02:23
created

test_mal   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 0
1
#!/usr/local/bin/python
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
# coding: utf-8
3
4
from titlesearch.mal import MyAnimeList
5
6
example_title = "Baka to Test"
0 ignored issues
show
Coding Style Naming introduced by
The name example_title does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
7
8
print('similar titles for: "{0:s}"'.format(example_title))
9
results = MyAnimeList.get_similar_titles(example_title)
0 ignored issues
show
Coding Style Naming introduced by
The name results does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
10
for title in results:
11
    print('similarity: {1:.2f}%, title: "{0:s}"'.format(title['title'], float(title['similarity']) * 100))
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (106/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
12
13
print('')
14
print('alternative titles for: "{0:s}"'.format(example_title))
15
alternate_titles = MyAnimeList.get_alternative_titles(title=example_title)
0 ignored issues
show
Coding Style Naming introduced by
The name alternate_titles does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
16
for language in alternate_titles:
17
    for title in alternate_titles[language]:
18
        print("[{0:s}]: {1:s}".format(language, title))
19