Showing 135 of 135 total issues
Identical blocks of code found in 2 locations. Consider refactoring. Open
return (self.gR*self.VmPFK*x[3]*(-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)*(1 + x[3]/self.KmPFKF6P + (-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)/((2 - 8*self.KeqAK)*self.KmPFKATP) + (self.gR*x[3]*(-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5))/((2 - 8*self.KeqAK)*self.KmPFKATP*self.KmPFKF6P)))/((2 - 8*self.KeqAK)*self.KmPFKATP*self.KmPFKF6P*((self.L0*(1 + (self.CPFKF26BP*self.F26BP)/self.KPFKF26BP + (self.CPFKF16BP*x[2])/self.KPFKF16BP)**2*(1 + (2*self.CPFKAMP*self.KeqAK*(self.SUMAXP - (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)**2)/((-1 + 4*self.KeqAK)*self.KPFKAMP*(self.SUMAXP - x[12] + 4*self.KeqAK*x[12] - (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)))**2*(1 + (self.CiPFKATP*(-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5))/((2 - 8*self.KeqAK)*self.KiPFKATP))**2*(1 + (self.CPFKATP*(-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5))/((2 - 8*self.KeqAK)*self.KmPFKATP))**2)/((1 + self.F26BP/self.KPFKF26BP + x[2]/self.KPFKF16BP)**2*(1 + (2*self.KeqAK*(self.SUMAXP - (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)**2)/((-1 + 4*self.KeqAK)*self.KPFKAMP*(self.SUMAXP - x[12] + 4*self.KeqAK*x[12] - (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)))**2*(1 + (-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)/((2 - 8*self.KeqAK)*self.KiPFKATP))**2) + (1 + x[3]/self.KmPFKF6P + (-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)/((2 - 8*self.KeqAK)*self.KmPFKATP) + (self.gR*x[3]*(-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5))/((2 - 8*self.KeqAK)*self.KmPFKATP*self.KmPFKF6P))**2))
- Read upRead up
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 465.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
return (self.VmPGK*((self.KeqPGK*x[1]*(self.SUMAXP - (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5))/(1 - 4*self.KeqAK) - (x[9]*(-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5))/(2 - 8*self.KeqAK)))/(self.KmPGKATP*self.KmPGKP3G*(1 + x[1]/self.KmPGKBPG + x[9]/self.KmPGKP3G)*(1 + (self.SUMAXP - (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)/((1 - 4*self.KeqAK)*self.KmPGKADP) + (-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)/((2 - 8*self.KeqAK)*self.KmPGKATP)))
- Read upRead up
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 437.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
return (self.VmGLK*(-((x[4]*(self.SUMAXP - (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)) /
((1 - 4*self.KeqAK)*self.KeqGLK)) + (x[5]*(-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5))/(2 - 8*self.KeqAK)))/(self.KmGLKATP*self.KmGLKGLCi*(1 + x[4]/self.KmGLKG6P + x[5]/self.KmGLKGLCi)*(1 + (self.SUMAXP - (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)/((1 - 4*self.KeqAK)*self.KmGLKADP) + (-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)/((2 - 8*self.KeqAK)*self.KmGLKATP)))
- Read upRead up
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 437.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File mrna_and_proteins_using_several_methods.py
has 743 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" Stochastic simulation tutorial
:Author: Jonathan Karr <jonrkarr@gmail.com>
:Date: 2017-08-30
:Copyright: 2017, Karr Lab
File model.py
has 671 lines of code (exceeds 250 allowed). Consider refactoring. Open
'''
Reads models specified in Excel into a Python object
@author Jonathan Karr, karr@mssm.edu
@date 3/22/2016
File model_composition.py
has 614 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" Model composition tutorial
- Glycolysis model (Teusink et al., 2000)
- Glycerol synthesis model (Cronwright et al., 2002)
Similar blocks of code found in 2 locations. Consider refactoring. Open
return (self.VmPYK*((x[10]*(self.SUMAXP - (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5))/(1 - 4*self.KeqAK) - ((-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)*x[11])/((2 - 8*self.KeqAK)*self.KeqPYK)))/(self.KmPYKADP*self.KmPYKPEP*(1 + (self.SUMAXP - (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)/((1 - 4*self.KeqAK)*self.KmPYKADP) + (-self.SUMAXP + x[12] - 4*self.KeqAK*x[12] + (self.SUMAXP**2 - 2*self.SUMAXP*x[12] + 8*self.KeqAK*self.SUMAXP*x[12] + x[12]**2 - 4*self.KeqAK*x[12]**2)**0.5)/((2 - 8*self.KeqAK)*self.KmPYKATP))*(1 + x[10]/self.KmPYKPEP + x[11]/self.KmPYKPYR))
- Read upRead up
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 145.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
m_percentiles[i, :] = [
numpy.percentile(m[i, :], 1),
numpy.percentile(m[i, :], 5),
numpy.percentile(m[i, :], 33.33),
numpy.percentile(m[i, :], 50),
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
n_percentiles[i, :] = [
numpy.percentile(n[i, :], 1),
numpy.percentile(n[i, :], 5),
numpy.percentile(n[i, :], 33.33),
numpy.percentile(n[i, :], 50),
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function getModelFromExcel
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def getModelFromExcel(filename):
# Reads model from Excel file into a Python object
with warnings.catch_warnings():
warnings.filterwarnings("ignore", "Discarded range with reserved name", UserWarning)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Similar blocks of code found in 2 locations. Consider refactoring. Open
class Specie(Base):
""" Represents a species
Attributes:
name (:obj:`str`): name
- Read upRead up
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 106.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
class Compartment(Base):
""" Represents an compartment
Attributes:
name (:obj:`str`): name
- Read upRead up
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 106.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def v_2(self, x):
# Glucose-6-phosphate isomerase
# G6P <=> F6P
return (self.VmPGI*(-(x[3]/self.KeqPGI) + x[4]))/(self.KmPGIG6P*(1 + x[3]/self.KmPGIF6P + x[4]/self.KmPGIG6P))
- Read upRead up
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 102.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def v_9(self, x):
# Phosphoglycerate mutase
# P3G <=> P2G
return (self.VmPGM*(-(x[8]/self.KeqPGM) + x[9]))/(self.KmPGMP3G*(1 + x[8]/self.KmPGMP2G + x[9]/self.KmPGMP3G))
- Read upRead up
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 102.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
def __init__(self, k_m=5, k_n=20, gamma_m=numpy.log(2) * 60 / 3, gamma_n=numpy.log(2) / 10, m_0=1, n_0=98):
"""
Args:
k_m (:obj:`float`, optional): mRNA synthesis rate constant (molecules h\ :sup:`-1`)
k_n (:obj:`float`, optional): protein synthesis rate constant (\ :sup:`-1`\ h\ :sup:`-1`)
- Read upRead up
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 94.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
def __init__(self, k_m=5, k_n=20, gamma_m=numpy.log(2) * 60 / 3, gamma_n=numpy.log(2) / 10, m_0=1, n_0=98):
"""
Args:
k_m (:obj:`float`, optional): mRNA synthesis rate constant (molecules h\ :sup:`-1`)
k_n (:obj:`float`, optional): protein synthesis rate constant (\ :sup:`-1`\ h\ :sup:`-1`)
- Read upRead up
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 94.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
GlycolysisModel
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class GlycolysisModel(object):
""" Glycolysis model (Teusink et al., 2000)
Based on the `version from JWS Online <http://jjj.biochem.sun.ac.za/models/teusink/>`_
Function simulate
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def simulate(mdl):
# simulates model
# Get metabolism submodel
submdl = mdl.getComponentById('Metabolism')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Similar blocks of code found in 2 locations. Consider refactoring. Open
def dNAD_dt(self, x):
return 1.0 * self.v_15(x) + 1.0 * self.v_16(x) - 1.0 * self.v_7(x) - 3.0 * self.v_13(x)
- Read upRead up
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 76.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def dNADH_dt(self, x):
return 1.0 * self.v_7(x) + 3.0 * self.v_13(x) - 1.0 * self.v_15(x) - 1.0 * self.v_16(x)
- Read upRead up
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 76.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76