deeplearning4j/deeplearning4j

View on GitHub

Showing 13,634 of 13,634 total issues

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

Severity: Major
Found in libnd4j/include/graph/generated/nd4j/graph/LongTriple.py and 1 other location - About 3 days to fix
libnd4j/include/graph/generated/nd4j/graph/IntTriple.py on lines 0..46

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

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

Severity: Major
Found in libnd4j/include/graph/generated/nd4j/graph/IntTriple.py and 1 other location - About 3 days to fix
libnd4j/include/graph/generated/nd4j/graph/LongTriple.py on lines 0..46

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

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

StaticInfoDecoder has 183 methods (exceeds 20 allowed). Consider refactoring.
Open

@javax.annotation.Generated(value = {"org.deeplearning4j.ui.stats.sbe.StaticInfoDecoder"})
@SuppressWarnings("all")
public class StaticInfoDecoder {
    public static final int BLOCK_LENGTH = 40;
    public static final int TEMPLATE_ID = 1;

    Function readGraphStructure has a Cognitive Complexity of 178 (exceeds 5 allowed). Consider refactoring.
    Open

    function readGraphStructure(){
        //First: load data
        if (file) {
            var fr = new FileReader();
            var fileData = new Blob([file]);            //TODO Don't load the whole file into memory at once!

    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 TrainModule.java has 1373 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*******************************************************************************
     * Copyright (c) 2015-2018 Skymind, Inc.
     *
     * This program and the accompanying materials are made available under the
     * terms of the Apache License, Version 2.0 which is available at

      File dl4j-ui.js has 1332 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*******************************************************************************
       * Copyright (c) 2015-2018 Skymind, Inc.
       *
       * This program and the accompanying materials are made available under the
       * terms of the Apache License, Version 2.0 which is available at

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

        // automatically generated by the FlatBuffers compiler, do not modify
        
        package nd4j.graph;
        
        import java.nio.*;
        Severity: Major
        Found in libnd4j/include/graph/generated/nd4j/graph/UIVariable.java and 1 other location - About 3 days to fix
        nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/graph/UIVariable.java on lines 1..109

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

        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

        // automatically generated by the FlatBuffers compiler, do not modify
        
        package org.nd4j.graph;
        
        import java.nio.*;
        libnd4j/include/graph/generated/nd4j/graph/UIVariable.java on lines 1..108

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

        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 dl4j-ui.js has 1318 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var __extends = (this && this.__extends) || function (d, b) {
            for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
            function __() { this.constructor = d; }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
        };

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

          // automatically generated by the FlatBuffers compiler, do not modify
          
          package org.nd4j.graph;
          
          import java.nio.*;
          libnd4j/include/graph/generated/nd4j/graph/FlatProperties.java on lines 1..97

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

          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

          // automatically generated by the FlatBuffers compiler, do not modify
          
          package nd4j.graph;
          
          import java.nio.*;
          Severity: Major
          Found in libnd4j/include/graph/generated/nd4j/graph/FlatProperties.java and 1 other location - About 3 days to fix
          nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/graph/FlatProperties.java on lines 1..98

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

          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 UpdateEncoder.java has 1298 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*******************************************************************************
           * Copyright (c) 2015-2018 Skymind, Inc.
           *
           * This program and the accompanying materials are made available under the
           * terms of the Apache License, Version 2.0 which is available at

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

            var Style = (function () {
                function Style(jsonObj) {
                    var _this = this;
                    this.getWidth = function () { return _this.width; };
                    this.getHeight = function () { return _this.height; };
            arbiter/arbiter-ui/src/main/resources/deeplearning4jUiAssets/dl4j-ui.js on lines 6..41

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

            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

            var Style = (function () {
                function Style(jsonObj) {
                    var _this = this;
                    this.getWidth = function () { return _this.width; };
                    this.getHeight = function () { return _this.height; };
            deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui-components/src/main/resources/assets/dl4j-ui.js on lines 27..62

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

            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

            // automatically generated by the FlatBuffers compiler, do not modify
            
            package org.nd4j.graph;
            
            import java.nio.*;
            libnd4j/include/graph/generated/nd4j/graph/FlatGraph.java on lines 1..92

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

            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

            // automatically generated by the FlatBuffers compiler, do not modify
            
            package nd4j.graph;
            
            import java.nio.*;
            Severity: Major
            Found in libnd4j/include/graph/generated/nd4j/graph/FlatGraph.java and 1 other location - About 3 days to fix
            nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/graph/FlatGraph.java on lines 1..93

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

            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

            Method run has a Cognitive Complexity of 155 (exceeds 5 allowed). Consider refactoring.
            Open

                public SharedTrainingResult run(SharedTrainingWorker worker) {
                    /*
                        first call instantiates pw, messenger etc, and gets in charge here.
                     */
                    if (isFirst.compareAndSet(false, true)) {

            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

            StaticInfoEncoder has 152 methods (exceeds 20 allowed). Consider refactoring.
            Open

            @javax.annotation.Generated(value = {"org.deeplearning4j.ui.stats.sbe.StaticInfoEncoder"})
            @SuppressWarnings("all")
            public class StaticInfoEncoder {
                public static final int BLOCK_LENGTH = 40;
                public static final int TEMPLATE_ID = 1;

              Method getAndParameterizeOp has a Cognitive Complexity of 146 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  public DifferentialFunction getAndParameterizeOp(String opName, FrameIter frameIter, Set<VarId> opInputs, Set<VarId> allIterInputs,
                                                                   Set<String> constAndPhInputs, Map<String,INDArray> placeholderValues) {
              
                      DifferentialFunction df = sameDiff.getOpById(opName);

              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 BaseCudaDataBuffer.java has 1138 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*******************************************************************************
               * Copyright (c) 2015-2018 Skymind, Inc.
               *
               * This program and the accompanying materials are made available under the
               * terms of the Apache License, Version 2.0 which is available at
                Severity
                Category
                Status
                Source
                Language