Passed
Push — main ( 5eb671...d31494 )
by Jose Enrique
41:14 queued 32:12
created

mutis.tests.test_signal   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2

2 Functions

Rating   Name   Duplication   Size   Complexity  
A test_generation() 0 2 1
A profile() 0 5 1
1
import pytest
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
introduced by
Unable to import 'pytest'
Loading history...
2
import numpy as np
0 ignored issues
show
introduced by
Unable to import 'numpy'
Loading history...
3
from mutis.signal import Signal
4
5
6
@pytest.fixture
7
def profile():
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
8
    p = {"times": np.linspace(10, 20, 100)}
0 ignored issues
show
Coding Style Naming introduced by
Variable name "p" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

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...
9
    p["values"] = 0.5 * np.sin(1 * p["times"]) + 0.5 * np.sin(6*p["times"]) + 1
10
    return p
11
12
13
def test_generation(profile):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
Comprehensibility Bug introduced by
profile is re-defining a name which is already available in the outer-scope (previously defined on line 7).

It is generally a bad practice to shadow variables from the outer-scope. In most cases, this is done unintentionally and might lead to unexpected behavior:

param = 5

class Foo:
    def __init__(self, param):   # "param" would be flagged here
        self.param = param
Loading history...
14
    signal = Signal(profile["times"], profile["values"], "lc_gen_samp")
0 ignored issues
show
Unused Code introduced by
The variable signal seems to be unused.
Loading history...
15
16
0 ignored issues
show
coding-style introduced by
Trailing newlines
Loading history...
17