deeplearning4j/deeplearning4j

View on GitHub
resources/src/main/java/org/nd4j/common/resources/strumpf/StrumpfResolver.java

Summary

Maintainability
D
1 day
Test Coverage

Method copyDirectory has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void copyDirectory(String dirPath, File destinationDir) {
        //First: check local resource dir
        boolean resolved = false;
        if (localResourceDirs != null && !localResourceDirs.isEmpty()) {

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 exists has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean exists(@NonNull String resourcePath) {
        //First: check local dirs (if any exist)
        if (localResourceDirs != null && !localResourceDirs.isEmpty()) {
            for (String s : localResourceDirs) {

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 asFile has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public File asFile(String resourcePath) {
        assertExists(resourcePath);

        if (localResourceDirs != null && !localResourceDirs.isEmpty()) {

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 copyDirectory has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public void copyDirectory(String dirPath, File destinationDir) {
        //First: check local resource dir
        boolean resolved = false;
        if (localResourceDirs != null && !localResourceDirs.isEmpty()) {

    Method asFile has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        public File asFile(String resourcePath) {
            assertExists(resourcePath);
    
            if (localResourceDirs != null && !localResourceDirs.isEmpty()) {

      Method directoryExists has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public boolean directoryExists(String dirPath) {
              //First: check local dirs (if any)
              if (localResourceDirs != null && !localResourceDirs.isEmpty()) {
                  for (String s : localResourceDirs) {

      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

      Avoid too many return statements within this method.
      Open

              return false;

        There are no issues that match your filters.

        Category
        Status