deeplearning4j/deeplearning4j

View on GitHub
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/versioncheck/VersionCheck.java

Summary

Maintainability
D
1 day
Test Coverage

Method checkVersions has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

    public static void checkVersions(){
        boolean doCheck = Boolean.parseBoolean(System.getProperty(ND4JSystemProperties.VERSION_CHECK_PROPERTY, "true"));

        if(!doCheck){
            return;

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

    public static void checkVersions(){
        boolean doCheck = Boolean.parseBoolean(System.getProperty(ND4JSystemProperties.VERSION_CHECK_PROPERTY, "true"));

        if(!doCheck){
            return;

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

        public static List<URI> listGitPropertiesFiles() {
            Enumeration<URL> roots;
            try {
                roots = VersionCheck.class.getClassLoader().getResources("ai/skymind/");
            } catch (IOException e){

      Method getVersionInfos has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static List<VersionInfo> getVersionInfos() {
      
              boolean dl4jFound = false;
              boolean datavecFound = false;
      
      

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

          public static List<VersionInfo> getVersionInfos() {
      
              boolean dl4jFound = false;
              boolean datavecFound = false;
      
      

        Method listGitPropertiesFiles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static List<URI> listGitPropertiesFiles() {
                Enumeration<URL> roots;
                try {
                    roots = VersionCheck.class.getClassLoader().getResources("ai/skymind/");
                } catch (IOException e){

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

            public static String versionInfoString(Detail detail) {
                StringBuilder sb = new StringBuilder();
                for(VersionInfo grp : getVersionInfos()){
                    sb.append(grp.getGroupId()).append(" : ").append(grp.getArtifactId()).append(" : ").append(grp.getBuildVersion());
                    switch (detail){

        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

        There are no issues that match your filters.

        Category
        Status