pbrod/numdifftools

View on GitHub
src/numdifftools/example_functions.py

Summary

Maintainability
A
1 hr
Test Coverage

Use 'from scipy import special' instead
Open

import scipy.special as special

Emitted when a submodule of a package is imported and aliased with the same name, e.g., instead of import concurrent.futures as futures use from concurrent import futures.

Consider using '{cosh: derivative_cosh, cos: derivative_cos, sin: derivative_sin, ... }' instead of a call to 'dict'.
Open

    f_dic = dict(cosh=derivative_cosh,

Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.

Unused argument 'n'
Open

def derivative_exp(n):

Used when a function or method argument is not used.

Unable to import 'numpy'
Open

from numpy import (cos, sin, tan, cosh, sinh, tanh,
Severity: Critical
Found in src/numdifftools/example_functions.py by pylint

Used when pylint has been unable to import a module.

Unused log2 imported from numpy
Open

from numpy import (cos, sin, tan, cosh, sinh, tanh,

Used when an imported module or variable is not used.

Unable to import 'numpy'
Open

import numpy as np
Severity: Critical
Found in src/numdifftools/example_functions.py by pylint

Used when pylint has been unable to import a module.

Unused log10 imported from numpy
Open

from numpy import (cos, sin, tan, cosh, sinh, tanh,

Used when an imported module or variable is not used.

Unable to import 'scipy.special'
Open

import scipy.special as special
Severity: Critical
Found in src/numdifftools/example_functions.py by pylint

Used when pylint has been unable to import a module.

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def ddtan(x):
        return 2 * tan(x) / cos(x)**2
Severity: Minor
Found in src/numdifftools/example_functions.py and 1 other location - About 45 mins to fix
src/numdifftools/example_functions.py on lines 115..116

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 35.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def ddtanh(x):
        return -2 * sinh(x) / cosh(x) ** 3
Severity: Minor
Found in src/numdifftools/example_functions.py and 1 other location - About 45 mins to fix
src/numdifftools/example_functions.py on lines 90..91

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 35.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Missing function or method docstring
Open

def derivative_tan(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_cosh(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_tanh(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_exp(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_expm1(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_log1p(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_arctanh(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_arccos(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_sqrt(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_log(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def get_function(fun_name, n=1):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_inv(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_arcsinh(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Variable name sx doesn't conform to '[a-z_][a-z0-9_]{2,30}$' pattern ('[a-z_][a-z0-9_]{2,30}$' pattern)
Open

        sx = sqrt(x)

Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

Missing function or method docstring
Open

def derivative_sinh(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def darccos(x):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_arccosh(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def dddarccos(x):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_log2(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def dddarcsin(x):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_arcsin(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_arctan(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_square(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def ddarccos(x):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_exp2(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def ddarcsin(x):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_sin(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_cos(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def darcsin(x):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

Missing function or method docstring
Open

def derivative_log10(n):

Used when a function or method has no docstring. Some special methods like init do not require a docstring.

There are no issues that match your filters.

Category
Status