deeplearning4j/deeplearning4j

View on GitHub
nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java

Summary

Maintainability
F
3 days
Test Coverage

Method dataTypeForTvmType has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public static DataType dataTypeForTvmType(DLDataType dataType) {
        if(dataType.code() == kDLInt && dataType.bits() == 8) {
            return INT8;
        } else if(dataType.code() == kDLInt && dataType.bits() == 16) {
            return INT16;
Severity: Minor
Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 3 hrs 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

Method getDataBuffer has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static DataBuffer getDataBuffer(DLTensor tens, long size) {
        DataBuffer buffer = null;
        DataType type = dataTypeForTvmType(tens.dtype());
        switch (type) {
            case BYTE:
Severity: Major
Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 2 hrs to fix

    Method tvmTypeForDataType has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public static DLDataType tvmTypeForDataType(DataType dataType) {
            if(dataType == INT8) {
                return new DLDataType().code((byte)kDLInt).bits((byte)8).lanes((short)1);
            } else if(dataType == INT16) {
                return new DLDataType().code((byte)kDLInt).bits((byte)16).lanes((short)1);
    Severity: Minor
    Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 1 hr 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

    Method tvmTypeForDataType has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static DLDataType tvmTypeForDataType(DataType dataType) {
            if(dataType == INT8) {
                return new DLDataType().code((byte)kDLInt).bits((byte)8).lanes((short)1);
            } else if(dataType == INT16) {
                return new DLDataType().code((byte)kDLInt).bits((byte)16).lanes((short)1);
    Severity: Minor
    Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 1 hr to fix

      Method dataTypeForTvmType has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static DataType dataTypeForTvmType(DLDataType dataType) {
              if(dataType.code() == kDLInt && dataType.bits() == 8) {
                  return INT8;
              } else if(dataType.code() == kDLInt && dataType.bits() == 16) {
                  return INT16;
      Severity: Minor
      Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 1 hr to fix

        Avoid too many return statements within this method.
        Open

                    return new DLDataType().code((byte)kDLUInt).bits((byte)32).lanes((short)1);
        Severity: Major
        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return INT32;
          Severity: Major
          Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return INT64;
            Severity: Major
            Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return UINT32;
              Severity: Major
              Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return new DLDataType().code((byte)kDLInt).bits((byte)8).lanes((short)1);
                Severity: Major
                Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return new DLDataType().code((byte)kDLUInt).bits((byte)8).lanes((short)1);
                  Severity: Major
                  Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return new DLDataType().code((byte)kDLInt).bits((byte)16).lanes((short)1);
                    Severity: Major
                    Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return UINT16;
                      Severity: Major
                      Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return new DLDataType().code((byte)kDLUInt).bits((byte)16).lanes((short)1);
                        Severity: Major
                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return UINT8;
                          Severity: Major
                          Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return new DLDataType().code((byte)kDLInt).bits((byte)32).lanes((short)1);
                            Severity: Major
                            Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return INT8;
                              Severity: Major
                              Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return new DLDataType().code((byte)kDLUInt).bits((byte)64).lanes((short)1);
                                Severity: Major
                                Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return new DLDataType().code((byte)kDLInt).bits((byte)64).lanes((short)1);
                                  Severity: Major
                                  Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return INT16;
                                    Severity: Major
                                    Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                  return UINT64;
                                      Severity: Major
                                      Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java - About 30 mins to fix

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

                                                    case LONG:
                                                        LongPointer pInt64 = new LongPointer(tens.data()).capacity(size);
                                                        Indexer int64Indexer = LongIndexer.create(pInt64);
                                                        buffer = Nd4j.createBuffer(pInt64, type, size, int64Indexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 167..171
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 172..176
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 177..181
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 187..191
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 192..196
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 197..201
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 202..206
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 207..211
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 212..216
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 217..221
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 222..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 52.

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

                                                    case UBYTE:
                                                        BytePointer pUint8 = new BytePointer(tens.data()).capacity(size);
                                                        Indexer uint8Indexer = UByteIndexer.create(pUint8);
                                                        buffer = Nd4j.createBuffer(pUint8, type, size, uint8Indexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 167..171
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 172..176
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 177..181
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 182..186
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 192..196
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 197..201
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 202..206
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 207..211
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 212..216
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 217..221
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 222..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 52.

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

                                                    case DOUBLE:
                                                        DoublePointer pDouble =  new DoublePointer(tens.data()).capacity(size);
                                                        Indexer doubleIndexer = DoubleIndexer.create(pDouble);
                                                        buffer = Nd4j.createBuffer(pDouble, type, size, doubleIndexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 167..171
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 172..176
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 177..181
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 182..186
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 187..191
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 192..196
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 197..201
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 202..206
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 207..211
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 212..216
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 222..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 52.

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

                                                    case SHORT:
                                                        ShortPointer pInt16 = new ShortPointer(tens.data()).capacity(size);
                                                        Indexer int16Indexer = ShortIndexer.create(pInt16);
                                                        buffer = Nd4j.createBuffer(pInt16, type, size, int16Indexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 167..171
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 177..181
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 182..186
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 187..191
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 192..196
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 197..201
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 202..206
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 207..211
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 212..216
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 217..221
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 222..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 52.

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

                                                    case INT:
                                                        IntPointer pInt32 = new IntPointer(tens.data()).capacity(size);
                                                        Indexer int32Indexer = IntIndexer.create(pInt32);
                                                        buffer = Nd4j.createBuffer(pInt32, type, size, int32Indexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 167..171
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 172..176
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 182..186
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 187..191
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 192..196
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 197..201
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 202..206
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 207..211
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 212..216
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 217..221
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 222..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 52.

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

                                                    case FLOAT:
                                                        FloatPointer pFloat =  new FloatPointer(tens.data()).capacity(size);
                                                        FloatIndexer floatIndexer = FloatIndexer.create(pFloat);
                                                        buffer = Nd4j.createBuffer(pFloat, type, size, floatIndexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 167..171
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 172..176
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 177..181
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 182..186
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 187..191
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 192..196
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 197..201
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 202..206
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 207..211
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 217..221
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 222..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 52.

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

                                                    case BYTE:
                                                        BytePointer pInt8 = new BytePointer(tens.data()).capacity(size);
                                                        Indexer int8Indexer = ByteIndexer.create(pInt8);
                                                        buffer = Nd4j.createBuffer(pInt8, type, size, int8Indexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 172..176
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 177..181
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 182..186
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 187..191
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 192..196
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 197..201
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 202..206
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 207..211
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 212..216
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 217..221
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 222..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 52.

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

                                                    case HALF:
                                                        ShortPointer pFloat16 = new ShortPointer(tens.data()).capacity(size);
                                                        Indexer float16Indexer = HalfIndexer.create(pFloat16);
                                                        buffer = Nd4j.createBuffer(pFloat16, type, size, float16Indexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 167..171
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 172..176
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 177..181
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 182..186
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 187..191
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 192..196
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 197..201
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 202..206
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 212..216
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 217..221
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 222..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 52.

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

                                                    case BFLOAT16:
                                                        ShortPointer pBfloat16 = new ShortPointer(tens.data()).capacity(size);
                                                        Indexer bfloat16Indexer = Bfloat16Indexer.create(pBfloat16);
                                                        buffer = Nd4j.createBuffer(pBfloat16, type, size, bfloat16Indexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 167..171
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 172..176
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 177..181
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 182..186
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 187..191
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 192..196
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 197..201
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 202..206
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 207..211
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 212..216
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 217..221

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

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

                                                    case UINT16:
                                                        ShortPointer pUint16 = new ShortPointer(tens.data()).capacity(size);
                                                        Indexer uint16Indexer = UShortIndexer.create(pUint16);
                                                        buffer = Nd4j.createBuffer(pUint16, type, size, uint16Indexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 167..171
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 172..176
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 177..181
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 182..186
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 187..191
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 197..201
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 202..206
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 207..211
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 212..216
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 217..221
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 222..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 52.

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

                                                    case UINT32:
                                                        IntPointer pUint32 = new IntPointer(tens.data()).capacity(size);
                                                        Indexer uint32Indexer = UIntIndexer.create(pUint32);
                                                        buffer = Nd4j.createBuffer(pUint32, type, size, uint32Indexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 167..171
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 172..176
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 177..181
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 182..186
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 187..191
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 192..196
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 202..206
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 207..211
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 212..216
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 217..221
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 222..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 52.

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

                                                    case UINT64:
                                                        LongPointer pUint64 = new LongPointer(tens.data()).capacity(size);
                                                        Indexer uint64Indexer = LongIndexer.create(pUint64);
                                                        buffer = Nd4j.createBuffer(pUint64, type, size, uint64Indexer);
                                                        break;
                                        Severity: Major
                                        Found in nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java and 11 other locations - About 40 mins to fix
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 167..171
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 172..176
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 177..181
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 182..186
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 187..191
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 192..196
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 197..201
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 207..211
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 212..216
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 217..221
                                        nd4j/nd4j-tvm/src/main/java/org/nd4j/tvm/util/TVMUtils.java on lines 222..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 52.

                                        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