JASMINE-Mission/jasmine-imagesim

View on GitHub

Showing 2,807 of 2,807 total issues

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

    for iframe in range(0,nframe):

        #global position update
        dx,dy=np.random.rand(2)*0.01
#        dx,dy=0.0,0.0
Severity: Major
Found in src/jis/pixsim/works/ejas_persistence.py and 1 other location - About 3 days to fix
src/jis/pixsim/works/ejas_tracking.py on lines 116..140

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 329.

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

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

    for iframe in range(0,nframe):

        #global position update
        dx,dy=np.random.rand(2)*0.01
        x,y=x+dx,y+dy
Severity: Major
Found in src/jis/pixsim/works/ejas_tracking.py and 1 other location - About 3 days to fix
src/jis/pixsim/works/ejas_persistence.py on lines 118..160

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 329.

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

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

    for iframe in tqdm.tqdm(range(0,nframe)):

        #the positioning system is designed to match to the future upgrade of the large drift.
        #jx,jy=int(x),int(y)
        #interpix=rf.flat_interpix(flat,jx,jy,pixdim,figsw=0)
Severity: Major
Found in test/R1/mkpixcube_uniform.py and 1 other location - About 2 days to fix
test/R1/mkpixcube_sampling.py on lines 193..235

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 282.

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

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

    for iframe in tqdm.tqdm(range(0,nframe)):

        #the positioning system is designed to match to the future upgrade of the large drift.
        #jx,jy=int(x),int(y)
        #interpix=rf.flat_interpix(flat,jx,jy,pixdim,figsw=0)
Severity: Major
Found in test/R1/mkpixcube_sampling.py and 1 other location - About 2 days to fix
test/R1/mkpixcube_uniform.py on lines 188..230

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 282.

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

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

def read_trapped_charge(Qtrap,ix,iy,pixdim,figsw=0,figtag=0):
    #get trapped charge in local view from ix,iy,pixdim
    sx=ix+int(pixdim[0])
    sy=iy+int(pixdim[1])
    if(sx<np.shape(Qtrap)[0] and sy<np.shape(Qtrap)[1]):
Severity: Major
Found in src/jis/pixsim/works/ejas_tracking.py and 1 other location - About 2 days to fix
src/jis/pixsim/works/ejas_persistence.py on lines 31..49

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 219.

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

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

def read_trapped_charge(Qtrap,ix,iy,pixdim,figsw=0,figtag=0):
    #get trapped charge in local view from ix,iy,pixdim
    sx=ix+int(pixdim[0])
    sy=iy+int(pixdim[1])
    if(sx<np.shape(Qtrap)[0] and sy<np.shape(Qtrap)[1]):
Severity: Major
Found in src/jis/pixsim/works/ejas_persistence.py and 1 other location - About 2 days to fix
src/jis/pixsim/works/ejas_tracking.py on lines 31..49

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 219.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    if args['--psf']:
        phdul = fits.open(args['--psf'])
        psfarr = phdul[0].data
        psfheader = phdul[0].header
        psfcenter = (np.array(np.shape(psfarr))-1.0)*0.5 #psf center in the unit of fp-cell
Severity: Major
Found in test/bintest/mkpixcube.py and 2 other locations - About 1 day to fix
test/R1/mkpixcube_sampling.py on lines 84..98
test/R1/mkpixcube_uniform.py on lines 82..96

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 162.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    if args['--psf']:
        phdul = fits.open(args['--psf'])
        psfarr = phdul[0].data
        psfheader = phdul[0].header
        psfcenter = (np.array(np.shape(psfarr))-1.0)*0.5 #psf center in the unit of fp-cell
Severity: Major
Found in test/R1/mkpixcube_sampling.py and 2 other locations - About 1 day to fix
test/R1/mkpixcube_uniform.py on lines 82..96
test/bintest/mkpixcube.py on lines 83..96

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 162.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    if args['--psf']:
        phdul = fits.open(args['--psf'])
        psfarr = phdul[0].data
        psfheader = phdul[0].header
        psfcenter = (np.array(np.shape(psfarr))-1.0)*0.5 #psf center in the unit of fp-cell
Severity: Major
Found in test/R1/mkpixcube_uniform.py and 2 other locations - About 1 day to fix
test/R1/mkpixcube_sampling.py on lines 84..98
test/bintest/mkpixcube.py on lines 83..96

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 162.

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

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

def persistence_const_array(x,rho,Ei0,Qij):
    Qij_prev=np.copy(Qij)    
    dQij=dQ_const_array(x,rho,Ei0)
    dQi=np.sum(dQij,axis=2)
    Qij=dQij+Qij_prev*np.exp(-x)
Severity: Major
Found in src/jis/pixsim/works/ejas_persistence.py and 1 other location - About 1 day to fix
src/jis/pixsim/works/ejas_tracking.py on lines 21..29

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 144.

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

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

def persistence_const_array(x,rho,Ei0,Qij):
    Qij_prev=np.copy(Qij)    
    dQij=dQ_const_array(x,rho,Ei0)
    dQi=np.sum(dQij,axis=2)
    Qij=dQij+Qij_prev*np.exp(-x)
Severity: Major
Found in src/jis/pixsim/works/ejas_tracking.py and 1 other location - About 1 day to fix
src/jis/pixsim/works/ejas_persistence.py on lines 21..29

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 144.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    if args['-l']:
        lhdul = fits.open(args['-l'])
        ldata = lhdul[0].data
        lhead = lhdul[0].header
        tl    = ldata[0,:]
Severity: Major
Found in test/R1/mkpixcube_sampling.py and 2 other locations - About 1 day to fix
test/R1/mkpixcube_uniform.py on lines 66..73
test/bintest/mkpixcube.py on lines 67..74

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 134.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    if args['-l']:
        lhdul = fits.open(args['-l'])
        ldata = lhdul[0].data
        lhead = lhdul[0].header
        tl    = ldata[0,:]
Severity: Major
Found in test/bintest/mkpixcube.py and 2 other locations - About 1 day to fix
test/R1/mkpixcube_sampling.py on lines 68..75
test/R1/mkpixcube_uniform.py on lines 66..73

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 134.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    if args['-l']:
        lhdul = fits.open(args['-l'])
        ldata = lhdul[0].data
        lhead = lhdul[0].header
        tl    = ldata[0,:]
Severity: Major
Found in test/R1/mkpixcube_uniform.py and 2 other locations - About 1 day to fix
test/R1/mkpixcube_sampling.py on lines 68..75
test/bintest/mkpixcube.py on lines 67..74

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 134.

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

File extract_json.py has 527 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import numpy as np
import os
import json
import dataclasses
from typing import List
Severity: Major
Found in src/jis/photonsim/extract_json.py - About 1 day to fix

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

    def push_trapped_charge(Qtrap,ix,iy,pixdim,Qij):
        sx=ix+int(pixdim[0])
        sy=iy+int(pixdim[1])
        if(sx<np.shape(Qtrap)[0] and sy<np.shape(Qtrap)[1]):
            Qtrap[ix:sx,iy:sy,:]=Qij
    Severity: Major
    Found in src/jis/pixsim/works/ejas_persistence.py and 1 other location - About 1 day to fix
    src/jis/pixsim/works/ejas_tracking.py on lines 51..59

    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 128.

    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

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

    def push_trapped_charge(Qtrap,ix,iy,pixdim,Qij):
        sx=ix+int(pixdim[0])
        sy=iy+int(pixdim[1])
        if(sx<np.shape(Qtrap)[0] and sy<np.shape(Qtrap)[1]):
            Qtrap[ix:sx,iy:sy,:]=Qij
    Severity: Major
    Found in src/jis/pixsim/works/ejas_tracking.py and 1 other location - About 1 day to fix
    src/jis/pixsim/works/ejas_persistence.py on lines 51..59

    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 128.

    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

    Identical blocks of code found in 3 locations. Consider refactoring.
    Open

        if vd>0.0:
            theta_full = np.array([xdata*x_scale/pix_scale+drift_theta[0,:], ydata*y_scale/pix_scale+drift_theta[1,:]])
        else:
            theta_full = np.array([xdata*x_scale/pix_scale, ydata*y_scale/pix_scale])
    Severity: Major
    Found in test/bintest/mkpixcube.py and 2 other locations - About 7 hrs to fix
    test/R1/mkpixcube_sampling.py on lines 136..139
    test/R1/mkpixcube_uniform.py on lines 131..134

    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 117.

    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

    Identical blocks of code found in 3 locations. Consider refactoring.
    Open

        if vd>0.0:
            theta_full = np.array([xdata*x_scale/pix_scale+drift_theta[0,:], ydata*y_scale/pix_scale+drift_theta[1,:]])
        else:
            theta_full = np.array([xdata*x_scale/pix_scale, ydata*y_scale/pix_scale])
    Severity: Major
    Found in test/R1/mkpixcube_uniform.py and 2 other locations - About 7 hrs to fix
    test/R1/mkpixcube_sampling.py on lines 136..139
    test/bintest/mkpixcube.py on lines 131..134

    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 117.

    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

    Identical blocks of code found in 3 locations. Consider refactoring.
    Open

        if vd>0.0:
            theta_full = np.array([xdata*x_scale/pix_scale+drift_theta[0,:], ydata*y_scale/pix_scale+drift_theta[1,:]])
        else:
            theta_full = np.array([xdata*x_scale/pix_scale, ydata*y_scale/pix_scale])
    Severity: Major
    Found in test/R1/mkpixcube_sampling.py and 2 other locations - About 7 hrs to fix
    test/R1/mkpixcube_uniform.py on lines 131..134
    test/bintest/mkpixcube.py on lines 131..134

    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 117.

    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

    Severity
    Category
    Status
    Source
    Language