alex-agency/AMHub

View on GitHub

Showing 12 of 32 total issues

Function exports has 327 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function ( grunt ) {
  
  /** 
   * Load required Grunt tasks. These are installed based on the versions listed
   * in `package.json` when you do `npm install` in this directory.
Severity: Major
Found in Gruntfile.js - About 1 day to fix

    Function CreateContainerCtrl has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function CreateContainerCtrl( $scope, params, Cookies, Config, Image, Container, Env ) {
      var imageName = decodeURIComponent(params.name);
    
      $scope.settings = Cookies.settings;
      $scope.hostVolumes = [];
    Severity: Major
    Found in src/app/containers/createContainer/createContainer.js - About 4 hrs to fix

      File Gruntfile.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module.exports = function ( grunt ) {
        
        /** 
         * Load required Grunt tasks. These are installed based on the versions listed
         * in `package.json` when you do `npm install` in this directory.
      Severity: Minor
      Found in Gruntfile.js - About 3 hrs to fix

        Function CreateContainerCtrl has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

          function CreateContainerCtrl( $scope, params, Cookies, Config, Image, Container, Env ) {
          var imageName = decodeURIComponent(params.name);
        
          $scope.settings = Cookies.settings;
          $scope.hostVolumes = [];
        Severity: Minor
        Found in src/app/containers/createContainer/createContainer.js - 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

        Function config has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        .config( function config( $stateProvider ) {
          var home = 'home';
          $stateProvider
            .state( 'containerInfo', {
              url: 'containers/:name',
        Severity: Major
        Found in src/app/containers/containerInfo/containerInfo.js - About 2 hrs to fix

          Function config has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          .config( function config( $stateProvider ) {
            var home = 'home';
            var size = '';
            $stateProvider
              .state( 'createContainerMain', {
          Severity: Minor
          Found in src/app/containers/createContainer/createContainer.js - About 1 hr to fix

            Function ContainerInfoCtrl has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function ContainerInfoCtrl( $scope, params, $location, ContainerService, Container ) {
            
              ContainerService.getByName( decodeURIComponent(params.name) )
              .then(function( container ) {
                Container.get({ id: container.Id }, function( data ) {
            Severity: Minor
            Found in src/app/containers/containerInfo/containerInfo.js - About 1 hr to fix

              Function ContainerNetworkCtrl has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function ContainerNetworkCtrl( $scope, $q, Network ) {
              
                $scope.networks = [];
                var inspectNetwork = function( id ) {
                  Network.get({ id: id }, function( data ) {

                Avoid deeply nested control flow statements.
                Open

                                for(var j in addresses) {
                                  if(addresses[j].ip == containerIp) {
                                    addresses.splice(j,1);
                                    break;
                                  }
                Severity: Major
                Found in src/app/containers/containers.js - About 45 mins to fix

                  Function BindingAddressCtrl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    function BindingAddressCtrl( $scope, Cookies, Config, ContainerService ) {
                  
                    $scope.settings = Cookies.settings;
                  
                    if($scope.settings.disableAddressesLookup) {
                  Severity: Minor
                  Found in src/app/containers/createContainer/bindingAddress/bindingAddress.js - About 45 mins 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

                  Function ImagesCtrl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    function ImagesCtrl( $scope, $interval, Cookies, ImageService ) {
                  
                    $scope.settings = Cookies.settings;
                    $scope.searchThreshold = 10;
                    $scope.viewLimit = 10;
                  Severity: Minor
                  Found in src/app/images/images.js - About 35 mins 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

                  Function ContainerInfoCtrl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    function ContainerInfoCtrl( $scope, params, $location, ContainerService, Container ) {
                  
                    ContainerService.getByName( decodeURIComponent(params.name) )
                    .then(function( container ) {
                      Container.get({ id: container.Id }, function( data ) {
                  Severity: Minor
                  Found in src/app/containers/containerInfo/containerInfo.js - About 25 mins 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

                  Severity
                  Category
                  Status
                  Source
                  Language