Showing 665 of 665 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
this._pht =
phtKoeff === 1
? Number.POSITIVE_INFINITY
: Math.abs(vMaxTime - (time0 - phtKoeff * time1) / (1 - phtKoeff)) * 1000;
- 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 57.
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
_prepareBBox() {
const HelpersBoundingBoxConstructor = helpersBoundingBox(three);
this._bBox = new HelpersBoundingBoxConstructor(this._stack);
this.add(this._bBox);
}
- 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 57.
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
rows(frameIndex = 0) {
let rows = this._dataSet.uint16('x00280010');
if (typeof rows === 'undefined') {
rows = null;
- 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 57.
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
columns(frameIndex = 0) {
let columns = this._dataSet.uint16('x00280011');
if (typeof columns === 'undefined') {
columns = null;
- 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 57.
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 helpersVolumeRendering
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const helpersVolumeRendering = (three = window.THREE) => {
if (three === undefined || three.Object3D === undefined) {
return null;
}
- 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
Function helpersContour
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const helpersContour = (three = window.THREE) => {
if (three === undefined || three.Object3D === undefined) {
return null;
}
- 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
Function dimensionIndexValues
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
dimensionIndexValues(frameIndex = 0) {
let dimensionIndexValues = null;
// try to get it from enhanced MR images
// per-frame functionnal group sequence
- 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
Function zSpacing
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
zSpacing() {
if (this._numberOfFrames > 1) {
if (this._frame[0].pixelSpacing && this._frame[0].pixelSpacing[2]) {
this._spacing.z = this._frame[0].pixelSpacing[2];
} else {
- 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
Function instanceNumber
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
instanceNumber(frameIndex = 0) {
let instanceNumber = null;
// first look for frame!
// per frame functionnal group sequence
let perFrameFunctionnalGroupSequence = this._dataSet.elements.x52009230;
- 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
Function _orderFrameOnDimensionIndicesArraySort
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_orderFrameOnDimensionIndicesArraySort(a, b) {
if (
'dimensionIndexValues' in a &&
Object.prototype.toString.call(a.dimensionIndexValues) === '[object Array]' &&
'dimensionIndexValues' in b &&
- 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
Function stringToNumber
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
static stringToNumber(numberAsString) {
let number = Number(numberAsString);
// returns true is number is NaN
if (number !== number) {
- 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
Function main
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
main() {
// need to pre-call main to fill up the functions list
this._main = `
float luma (vec3 rgb) {
Function _decompressUncompressed
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_decompressUncompressed(frameIndex = 0) {
let buffer = this._buffer;
let numberOfChannels = this.numberOfChannels();
let numPixels = this.rows(frameIndex) * this.columns(frameIndex) * numberOfChannels;
if (!this.rightHanded()) {
Function uniforms
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static uniforms() {
return {
uCanvasWidth: {
type: 'f',
value: 0,
Function updateMeshPosition
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateMeshPosition() {
if (this._mesh) {
this.remove(this._mesh);
}
Function onEnd
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
onEnd() {
if (this._handles.length < 3) {
return;
}
Function cosines
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
cosines() {
let cosines = [new Vector3(1, 0, 0), new Vector3(0, 1, 0), new Vector3(0, 0, 1)];
if (this._imageOrientation && this._imageOrientation.length === 6) {
let xCos = new Vector3(
Function _readLong
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_readLong(len = 1) {
let tempBuff = new DataView(this._buffer.slice(this._bufferPos, this._bufferPos + len * 8));
this._bufferPos += len * 8;
let v = new Uint16Array(len);
for (let i = 0; i < len; i++) {
Function main
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
main() {
// need to pre-call main to fill up the functions list
this._main = `
void main(void) {
Function _prepareMaterial
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_prepareMaterial() {
if (!this._material) {
// reference plane
this._uniforms.uSlice.value = this._referencePlane;