This repo hasn't had a successful analysis for its default branch yet.

HajimeKawahara/exojax

View on GitHub

Showing 31 of 31 total issues

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

def getix(x, xv):
"""jnp version of getix.
 
Args:
x: x array
Severity: Major
Found in src/exojax/utils/indexing.py and 1 other location - About 3 hrs to fix
src/exojax/utils/indexing.py on lines 72..89

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

def npgetix(x, xv):
"""numpy version of getix.
 
Args:
x: x array
Severity: Major
Found in src/exojax/utils/indexing.py and 1 other location - About 3 hrs to fix
src/exojax/utils/indexing.py on lines 43..69

Identical blocks of code found in 2 locations. Consider refactoring.
Confirmed

f = f + y / jnp.pi * (-jnp.cos(2.0 * xy) * Sigma1 + 0.5 * Sigma23)
Severity: Major
Found in src/exojax/special/faddeeva.py and 1 other location - About 2 hrs to fix
src/exojax/special/faddeeva.py on lines 100..100

Identical blocks of code found in 2 locations. Consider refactoring.
Confirmed

f = f + y / jnp.pi * (-jnp.cos(2.0 * xy) * Sigma1 + 0.5 * Sigma23)
Severity: Major
Found in src/exojax/special/faddeeva.py and 1 other location - About 2 hrs to fix
src/exojax/special/faddeeva.py on lines 176..176

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

def _psat_water_buck_liquid(T):
# return 0.0061121*jnp.exp((18.729*T - T**2/227.3)/(T + 257.87)) AM Appendix but old
return 0.0061121 * jnp.exp(
(18.678 * T - T**2 / 234.5) / (T + 257.14)
Severity: Major
Found in src/exojax/atm/psat.py and 1 other location - About 2 hrs to fix
src/exojax/atm/psat.py on lines 52..53

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

def _psat_water_buck_ice(T):
return 0.0061115 * jnp.exp((23.036 * T - T**2 / 333.7) / (T + 279.82))
Severity: Major
Found in src/exojax/atm/psat.py and 1 other location - About 2 hrs to fix
src/exojax/atm/psat.py on lines 56..59

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

py = np.array([dgm_gammaL[i, 0], dgm_gammaL[i, -1],
dgm_gammaL[i, -1], dgm_gammaL[i, 0]])
Severity: Major
Found in src/exojax/plot/ditplot.py and 1 other location - About 2 hrs to fix
src/exojax/plot/ditplot.py on lines 52..53

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

px = np.array([dgm_sigmaD[i, 0], dgm_sigmaD[i, 0],
dgm_sigmaD[i, -1], dgm_sigmaD[i, -1]])
Severity: Major
Found in src/exojax/plot/ditplot.py and 1 other location - About 2 hrs to fix
src/exojax/plot/ditplot.py on lines 54..55

Identical blocks of code found in 2 locations. Consider refactoring.
Confirmed

(jnp.exp(-((an + x) ** 2)) + jnp.exp(-((an - x) ** 2))) / (a2n2 + y2)
Severity: Major
Found in src/exojax/special/faddeeva.py and 1 other location - About 2 hrs to fix
src/exojax/special/faddeeva.py on lines 173..173

Identical blocks of code found in 2 locations. Consider refactoring.
Confirmed

(jnp.exp(-((an + x) ** 2)) + jnp.exp(-((an - x) ** 2))) / (a2n2 + y * y)
Severity: Major
Found in src/exojax/special/faddeeva.py and 1 other location - About 2 hrs to fix
src/exojax/special/faddeeva.py on lines 97..97

Similar blocks of code found in 3 locations. Consider refactoring.
Confirmed

neighbor_indices[i, 2], multi_index_update = find_or_add_index(
multi_index[i, :] + np.array([1, 1]), multi_index_update
Severity: Major
Found in src/exojax/utils/indexing.py and 2 other locations - About 1 hr to fix
src/exojax/utils/indexing.py on lines 158..159
src/exojax/utils/indexing.py on lines 161..162

Similar blocks of code found in 3 locations. Consider refactoring.
Confirmed

neighbor_indices[i, 0], multi_index_update = find_or_add_index(
multi_index[i, :] + np.array([1, 0]), multi_index_update
Severity: Major
Found in src/exojax/utils/indexing.py and 2 other locations - About 1 hr to fix
src/exojax/utils/indexing.py on lines 161..162
src/exojax/utils/indexing.py on lines 164..165

Similar blocks of code found in 3 locations. Consider refactoring.
Confirmed

neighbor_indices[i, 1], multi_index_update = find_or_add_index(
multi_index[i, :] + np.array([0, 1]), multi_index_update
Severity: Major
Found in src/exojax/utils/indexing.py and 2 other locations - About 1 hr to fix
src/exojax/utils/indexing.py on lines 158..159
src/exojax/utils/indexing.py on lines 164..165

Function plottau has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def plottau(nugrid, dtauM, Tarr=None, Parr=None, unit=None, mode=None, vmin=-3, vmax=3):
"""Plot optical depth (tau). This function gives the color map of log10(tau) (or log10(dtau)), optionally w/ a T-P profile.
 
Args:
nus: wavenumber in linear scale
Severity: Minor
Found in src/exojax/plot/atmplot.py - About 1 hr to fix

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

/ (x4 + C1 * x3 + C2 * x2 + C3 * x + C4)
Severity: Major
Found in src/exojax/special/expn.py and 1 other location - About 1 hr to fix
src/exojax/special/expn.py on lines 39..39

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

* (x4 + B1 * x3 + B2 * x2 + B3 * x + B4)
Severity: Major
Found in src/exojax/special/expn.py and 1 other location - About 1 hr to fix
src/exojax/special/expn.py on lines 40..40

Function plot_lbd has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Confirmed

def plot_lbd(
lbd_coeff,
elower_grid,
ngamma_ref_grid,
n_Texp_grid,
Severity: Minor
Found in src/exojax/plot/opaplot.py - About 1 hr to fix

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

    an = jnp.array(
    [
    0.5,
    1.0,
    1.5,
    Severity: Major
    Found in src/exojax/special/faddeeva.py and 1 other location - About 1 hr to fix
    src/exojax/special/faddeeva.py on lines 44..72

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

    a2n2 = jnp.array(
    [
    0.25,
    1.0,
    2.25,
    Severity: Major
    Found in src/exojax/special/faddeeva.py and 1 other location - About 1 hr to fix
    src/exojax/special/faddeeva.py on lines 12..40

    Similar blocks of code found in 4 locations. Consider refactoring.
    Confirmed

    Severity: Major
    Found in src/exojax/utils/__init__.py and 3 other locations - About 50 mins to fix
    src/exojax/atm/__init__.py on lines 0..8
    src/exojax/data/__init__.py on lines 0..8
    src/exojax/__init__.py on lines 0..8
    Severity
    Category
    Status
    Source
    Language