deeplearning4j/deeplearning4j

View on GitHub
codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt

Summary

Maintainability
F
3 wks
Test Coverage

Method SDCNN has a Cognitive Complexity of 664 (exceeds 20 allowed). Consider refactoring.
Open

fun SDCNN() =  Namespace("CNN"){
    val namespaceJavaPackage = "org.nd4j.linalg.api.ops.impl.layers.convolution"

    val dataFormat = Mixin("dataFormat"){
        Arg(ENUM, "dataFormat") { possibleValues = listOf("NCHW", "NHWC"); description = "Data format: \"NCHW\" or \"NHWC\"" }
Severity: Minor
Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt - About 1 wk to fix

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

File CNN.kt has 452 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 *  ******************************************************************************
 *  *
 *  *
 *  * This program and the accompanying materials are made available under the
Severity: Minor
Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt - About 6 hrs to fix

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

        val pooling2DConfig = Config("Pooling2DConfig"){
            Arg(LONG, "kH"){ description = "Kernel height"; defaultValue=-1}
            Arg(LONG, "kW"){ description = "Kernel width"; defaultValue=-1}
            Arg(LONG, "sH"){ description = "Stride along height dimension"; defaultValue=1};
            Arg(LONG, "sW"){ description = "Stride along width dimension"; defaultValue=1};
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 1 other location - About 1 day to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 48..60

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

    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

        val conv2DConfig = Config("Conv2DConfig"){
            Arg(LONG, "kH"){ description = "Kernel height"; defaultValue=-1L}
            Arg(LONG, "kW"){ description = "Kernel width"; defaultValue=-1L}
            Arg(LONG, "sH"){ description = "Stride along height dimension"; defaultValue=1};
            Arg(LONG, "sW"){ description = "Stride along width dimension"; defaultValue=1};
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 1 other location - About 1 day to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 118..130

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

    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 7 locations. Consider refactoring.
    Open

        Op("deconv3d") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "DeConv3D"
            Input(NUMERIC, "input") { description = "Input array - shape [bS, iD, iH, iW, iC] (NDHWC) or [bS, iC, iD, iH, iW] (NCDHW)" }
            Input(NUMERIC, "weights") { description = "Weights array - shape [kD, kH, kW, oC, iC]" }
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 6 other locations - About 4 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 230..245
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 249..264
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 269..284
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 288..302
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 344..359
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/RNN.kt on lines 334..351

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

    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 7 locations. Consider refactoring.
    Open

        Op("conv3d") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "Conv3D"
            Input(NUMERIC, "input") { description = "the input to average pooling 3d operation - 5d activations in NCDHW format (shape [minibatch, channels, depth, height, width]) or NDHWC format (shape [minibatch, depth, height, width, channels])" }
            Input(NUMERIC, "weights") { description = " Weights for conv3d. Rank 5 with shape [kernelDepth, kernelHeight, kernelWidth, inputChannels, outputChannels]." }
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 6 other locations - About 4 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 230..245
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 249..264
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 288..302
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 308..323
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 344..359
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/RNN.kt on lines 334..351

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

    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 7 locations. Consider refactoring.
    Open

        Op("deconv2d") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "DeConv2D"
            Input(NUMERIC, "layerInput") { description = "the input to deconvolution 2d operation - 4d CNN (image) activations in NCHW format (shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels])" }
            Input(NUMERIC, "weights") { description = "Weights for the 2d deconvolution operation. 4 dimensions with format [inputChannels, outputChannels, kernelHeight, kernelWidth]" }
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 6 other locations - About 4 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 230..245
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 249..264
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 269..284
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 308..323
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 344..359
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/RNN.kt on lines 334..351

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

    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 7 locations. Consider refactoring.
    Open

        Op("conv1d") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "Conv1D"
            Input(NUMERIC, "input") { description = "the inputs to conv1d" }
            Input(NUMERIC, "weights") { description = "weights for conv1d op - rank 3 array with shape [kernelSize, inputChannels, outputChannels]" }
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 6 other locations - About 4 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 249..264
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 269..284
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 288..302
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 308..323
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 344..359
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/RNN.kt on lines 334..351

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

    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 7 locations. Consider refactoring.
    Open

        Op("depthWiseConv2d") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "DepthwiseConv2D"
            Input(NUMERIC, "layerInput") { description = "the input to max pooling 2d operation - 4d CNN (image) activations in NCHW format" }
            Input(NUMERIC, "depthWeights") { description = "Depth-wise conv2d weights. 4 dimensions with format [kernelHeight, kernelWidth, inputChannels, depthMultiplier]" }
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 6 other locations - About 4 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 230..245
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 249..264
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 269..284
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 288..302
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 308..323
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/RNN.kt on lines 334..351

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

    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 7 locations. Consider refactoring.
    Open

        Op("conv2d") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "Conv2D"
            Input(NUMERIC, "layerInput") { description = "the input to max pooling 2d operation - 4d CNN (image) activations in NCHW format" }
            Input(NUMERIC, "weights") { description = "Weights for the convolution operation. 4 dimensions with format [kernelHeight, kernelWidth, inputChannels, outputChannels]" }
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 6 other locations - About 4 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 230..245
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 269..284
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 288..302
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 308..323
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 344..359
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/RNN.kt on lines 334..351

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

    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

        Op("col2Im") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "Col2Im"
    
            Input(NUMERIC, "in") { description = "Input - rank 6 input with shape [minibatch, inputChannels, kernelHeight, kernelWidth, outputHeight, outputWidth]" }
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 1 other location - About 2 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 402..416

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

    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

        Op("im2Col") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "Im2col"
            Input(NUMERIC, "in") { description = "Input - rank 4 input with shape [minibatch, inputChannels, height, width]" }
            useConfig(conv2DConfig)
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 1 other location - About 2 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 211..226

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

    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 5 locations. Consider refactoring.
    Open

        Op("avgPooling3d") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "AvgPooling3D"
            Input(NUMERIC, "input") {description = "the input to average pooling 3d operation - 5d activations in NCDHW format (shape [minibatch, channels, depth, height, width]) or NDHWC format (shape [minibatch, depth, height, width, channels])" }
            useConfig(pooling3DConfig)
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 4 other locations - About 2 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 164..177
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 418..431
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 433..446
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 464..477

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

    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 5 locations. Consider refactoring.
    Open

        Op("maxPooling3d") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "MaxPooling3D"
            Input(NUMERIC, "input") { description = "the input to average pooling 3d operation - 5d activations in NCDHW format (shape [minibatch, channels, depth, height, width]) or NDHWC format (shape [minibatch, depth, height, width, channels])" }
            useConfig(pooling3DConfig)
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 4 other locations - About 2 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 164..177
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 179..192
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 418..431
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 433..446

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

    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 5 locations. Consider refactoring.
    Open

        Op("maxPooling2d") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "MaxPooling2D"
            Input(NUMERIC, "input") { description = "the input to max pooling 2d operation - 4d CNN (image) activations in NCHW format (shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels])" }
            useConfig(pooling2DConfig)
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 4 other locations - About 2 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 164..177
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 179..192
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 418..431
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 464..477

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

    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 5 locations. Consider refactoring.
    Open

        Op("localResponseNormalization") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "LocalResponseNormalization"
            Input(NUMERIC, "input") { description = "the inputs to lrn" }
            useConfig(LocalResponseNormalizationConfig)
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 4 other locations - About 2 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 164..177
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 179..192
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 433..446
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 464..477

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

    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 5 locations. Consider refactoring.
    Open

        Op("avgPooling2d") {
            javaPackage = namespaceJavaPackage
            javaOpClass = "AvgPooling2D"
            Input(NUMERIC, "input") { description = "the input to average pooling 2d operation - 4d CNN (image) activations in NCHW format (shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels])" }
            useConfig(pooling2DConfig)
    Severity: Major
    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt and 4 other locations - About 2 hrs to fix
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 179..192
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 418..431
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 433..446
    codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt on lines 464..477

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

    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

    There are no issues that match your filters.

    Category
    Status