silverbux/laravel-angular-admin

View on GitHub

Showing 26 of 96 total issues

Function RoutesConfig has 365 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function RoutesConfig ($stateProvider, $urlRouterProvider) {
  'ngInject'

  var getView = (viewName) => {
    return `./views/app/pages/${viewName}/${viewName}.page.html`
Severity: Major
Found in angular/config/routes.config.js - About 1 day to fix

    File routes.config.js has 368 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export function RoutesConfig ($stateProvider, $urlRouterProvider) {
      'ngInject'
    
      var getView = (viewName) => {
        return `./views/app/pages/${viewName}/${viewName}.page.html`
    Severity: Minor
    Found in angular/config/routes.config.js - About 4 hrs to fix

      Function routeBodyClass has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      function routeBodyClass ($rootScope) {
        return {
          scope: {ngModel: '=ngModel'},
          link: function routeBodyClassLink (scope, elem) {
            $rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState) { // eslint-disable-line angular/on-watch
      Severity: Minor
      Found in angular/directives/route-bodyclass/route-bodyclass.component.js - About 2 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 $onInit has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        $onInit () {
          this.lineChartLabels = ['Januarys', 'February', 'March', 'April', 'May', 'June', 'July']
          this.lineChartSeries = ['Series A', 'Series B']
          this.lineChartData = [
            [65, 59, 80, 81, 56, 55, 40],
      Severity: Major
      Found in angular/app/components/charts-chartjs/charts-chartjs.component.js - About 2 hrs to fix

        File reset_link.blade.php has 258 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
          <meta name="viewport" content="width=device-width, initial-scale=1" />
        Severity: Minor
        Found in resources/views/emails/reset_link.blade.php - About 2 hrs to fix

          File userverification.blade.php has 258 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml">
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <meta name="viewport" content="width=device-width, initial-scale=1" />
          Severity: Minor
          Found in resources/views/emails/userverification.blade.php - About 2 hrs to fix

            Method run has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function run()
                {
                    DB::table('permission_role')->insert([
                        [
                            'id' => 1,
            Severity: Minor
            Found in database/seeds/PermissionRoleTableSeeder.php - About 1 hr to fix

              Method putMe has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function putMe(Request $request)
                  {
                      $user = Auth::user();
              
                      $this->validate($request, [
              Severity: Minor
              Found in app/Http/Controllers/UserController.php - About 1 hr to fix

                Method run has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function run()
                    {
                        DB::table('roles')->insert([
                            [
                                'id' => 1,
                Severity: Minor
                Found in database/seeds/RolesTableSeeder.php - About 1 hr to fix

                  Function RoutesRun has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function RoutesRun ($rootScope, $state, $auth, AclService, $timeout, API, ContextService) {
                    'ngInject'
                  
                    AclService.resume()
                  
                  
                  Severity: Minor
                  Found in angular/run/routes.run.js - About 1 hr to fix

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

                      constructor ($scope, $state, $compile, DTOptionsBuilder, DTColumnBuilder, API) {
                        'ngInject'
                        this.API = API
                        this.$state = $state
                    
                    
                    Severity: Minor
                    Found in angular/app/components/user-roles/user-roles.component.js - About 1 hr to fix

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

                        constructor ($scope, $state, $compile, DTOptionsBuilder, DTColumnBuilder, API) {
                          'ngInject'
                          this.API = API
                          this.$state = $state
                      
                      

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

                          constructor ($scope, $state, $compile, DTOptionsBuilder, DTColumnBuilder, API) {
                            'ngInject'
                            this.API = API
                            this.$state = $state
                        
                        
                        Severity: Minor
                        Found in angular/app/components/user-lists/user-lists.component.js - About 1 hr to fix

                          Function constructor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            constructor ($stateParams, $state, API) {
                              'ngInject'
                          
                              this.$state = $state
                              this.formSubmitted = false
                          Severity: Minor
                          Found in angular/app/components/user-edit/user-edit.component.js - About 1 hr to fix

                            Function passwordVerifyClass has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function passwordVerifyClass () {
                              return {
                                require: 'ngModel',
                                scope: {
                                  passwordVerify: '='
                            Severity: Minor
                            Found in angular/directives/password-verify/password-verify.component.js - About 1 hr to fix

                              Function getRolesAbilities has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function getRolesAbilities()
                                  {
                                      $abilities = [];
                                      $roles = Role::all();
                              
                              
                              Severity: Minor
                              Found in app/Http/Controllers/Auth/AuthController.php - 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

                              Function constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                constructor ($stateParams, $state, API) {
                                  'ngInject'
                              
                                  this.$state = $state
                                  this.formSubmitted = false
                              Severity: Minor
                              Found in angular/app/components/user-roles-edit/user-roles-edit.component.js - About 1 hr to fix

                                Method run has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function run()
                                    {
                                        DB::table('role_user')->insert([
                                            [
                                                'id' => 1,
                                Severity: Minor
                                Found in database/seeds/RoleUserTableSeeder.php - About 1 hr to fix

                                  Function constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    constructor (Restangular, $window) {
                                      'ngInject'
                                      // content negotiation
                                      var headers = {
                                        'Content-Type': 'application/json',
                                  Severity: Minor
                                  Found in angular/services/API.service.js - About 1 hr to fix

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

                                      delete (roleId) {
                                        let API = this.API
                                        let $state = this.$state
                                    
                                        swal({
                                    Severity: Minor
                                    Found in angular/app/components/user-roles/user-roles.component.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language