deeplearning4j/deeplearning4j

View on GitHub
python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java

Summary

Maintainability
D
1 day
Test Coverage

Python has 53 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Python {

    static {
        new PythonExecutioner();
    }
Severity: Major
Found in python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java - About 7 hrs to fix

    File Python.java has 296 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     *  ******************************************************************************
     *  *
     *  *
     *  * This program and the accompanying materials are made available under the
    Severity: Minor
    Found in python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java - About 3 hrs to fix

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

          public static PythonObject bytes(PythonObject pythonObject) {
              PythonObject bytesF = attr("bytes");
              PythonObject ret = bytesF.call(pythonObject);
              if (ret.isNone()) {
                  throw new PythonException("Cannot build bytes from object: " + pythonObject.toString());
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 246..254
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 277..285
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 312..320
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 347..355
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 405..413

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

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

          public static PythonObject memoryview(PythonObject pythonObject) {
              PythonObject mvF = attr("memoryview");
              PythonObject ret = mvF.call(pythonObject);
              if (ret.isNone()) {
                  throw new PythonException("Cannot build memoryview from object: " + pythonObject.toString());
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 246..254
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 277..285
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 312..320
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 370..378
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 405..413

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

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

          public static PythonObject bytearray(PythonObject pythonObject) {
              PythonObject baF = attr("bytearray");
              PythonObject ret = baF.call(pythonObject);
              if (ret.isNone()) {
                  throw new PythonException("Cannot build bytearray from object: " + pythonObject.toString());
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 246..254
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 277..285
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 347..355
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 370..378
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 405..413

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

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

          public static PythonObject set(PythonObject pythonObject) {
              PythonObject setF = attr("set");
              PythonObject ret = setF.call(pythonObject);
              if (ret.isNone()) {
                  throw new PythonException("Cannot build set from object: " + pythonObject.toString());
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 246..254
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 312..320
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 347..355
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 370..378
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 405..413

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

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

          public static PythonObject dict(PythonObject pythonObject) {
              PythonObject dictF = attr("dict");
              PythonObject ret = dictF.call(pythonObject);
              if (ret.isNone()) {
                  throw new PythonException("Cannot build dict from object: " + pythonObject.toString());
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 277..285
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 312..320
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 347..355
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 370..378
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 405..413

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

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

          public static PythonObject tuple(PythonObject pythonObject) {
              PythonObject tupleF = attr("tupleF");
              PythonObject ret = tupleF.call(pythonObject);
              if (ret.isNone()) {
                  throw new PythonException("Cannot build tuple from object: " + pythonObject.toString());
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 246..254
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 277..285
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 312..320
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 347..355
      python4j/python4j-core/src/main/java/org/nd4j/python4j/Python.java on lines 370..378

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

      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