RHeactorJS/web-app

View on GitHub

Showing 36 of 38 total issues

Function NavigationController has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function NavigationController (app) {
  app
    .controller('NavigationController', [
      'UserService',
      'ClientStorageService',
Severity: Major
Found in js/controller/navigation.js - About 4 hrs to fix

    Function BluebirdController has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    export const BluebirdController = angular => {
      angular
        .module('mwl.bluebird')
        .run(['$q', '$state', ($q, $state) => {
          $q.onPossiblyUnhandledRejection(error => {
    Severity: Minor
    Found in js/controller/bluebird.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 AccountProfileController has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function AccountProfileController ($rootScope, $timeout, ClientStorageService, UserService) {
      const self = this
      self.user = false
      self.userCopy = false
      self.p = new HttpProgress()
    Severity: Major
    Found in js/controller/account-profile.js - About 2 hrs to fix

      Function RegisterRHeactorJSServices has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const RegisterRHeactorJSServices = angular => {
        angular
          .module('RHeactorJSServiceModule', [])
          .factory('LoginService', ['$http', 'APIService', ($http, APIService) => {
            return new GenericAPIService($http, APIService, JsonWebToken.$context)
      Severity: Major
      Found in js/services/register-rheactor-services.js - About 2 hrs to fix

        Function AdminUserController has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function AdminUserController ($rootScope, $timeout, $stateParams, IDService, ClientStorageService, UserService) {
          const self = this
          self.user = false
          self.userCopy = false
          self.p = new HttpProgress()
        Severity: Major
        Found in js/controller/admin-user.js - About 2 hrs to fix

          Function LoginController has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function LoginController (app) {
            app
              .config(['$stateProvider', ($stateProvider) => {
                $stateProvider
                  .state('login', {
          Severity: Major
          Found in js/controller/login.js - About 2 hrs to fix

            Function MarkDownToHTMLDirective has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            export const MarkDownToHTMLDirective = ($location, $sanitize, $sce) => {
              return {
                restrict: 'A',
                link: function (scope, element, attrs) {
                  scope.$watch('model', function (newValue) {
            Severity: Minor
            Found in js/directives/markdown-to-html.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 link has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

              link: scope => {
                if (!scope.progress) {
                  scope.progress = new HttpProgress()
                }
                if (!scope.clickBindThis) scope.clickBindThis = scope
            Severity: Minor
            Found in js/directives/app-button.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 link has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              link: scope => {
                scope.p = new HttpProgress()
                scope.uploadFiles = (file, errFiles) => {
                  scope.f = file
                  scope.errFile = errFiles && errFiles[0]
            Severity: Major
            Found in js/directives/avatar-upload.js - About 2 hrs to fix

              Function PasswordChangeController has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function PasswordChangeController (app) {
                app
                  .config(['$stateProvider', function ($stateProvider) {
                    $stateProvider
                      .state('password-change', {
              Severity: Minor
              Found in js/controller/password-change.js - About 1 hr to fix

                Function AdminUsersController has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function AdminUsersController (ClientStorageService, UserService) {
                  const self = this
                  self.paginatedList = false
                  self.p = new HttpProgress()
                  self.l = new HttpProgress()
                Severity: Minor
                Found in js/controller/admin-users.js - About 1 hr to fix

                  Function AccountController has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function AccountController (app) {
                    app
                      .config(['$stateProvider', ($stateProvider) => {
                        $stateProvider
                          .state('account', {
                  Severity: Minor
                  Found in js/controller/account.js - About 1 hr to fix

                    Function uploadFiles has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        scope.uploadFiles = (file, errFiles) => {
                          scope.f = file
                          scope.errFile = errFiles && errFiles[0]
                          if (!file) return
                          scope.p.activity()
                    Severity: Minor
                    Found in js/directives/avatar-upload.js - About 1 hr to fix

                      Function connect has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        connect (token) {
                          if (this.source) {
                            logger.appWarning('EventSourceConnection', 'already connected!')
                            return this.source
                          }
                      Severity: Minor
                      Found in js/util/event-source-connection.js - About 1 hr to fix

                        Function connect has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        ModelEventConnection.prototype.connect = function (token) {
                          let self = this
                          if (self.source) {
                            logger.appWarning('ModelEventConnection', 'already connected!')
                            return self.source
                        Severity: Minor
                        Found in js/util/model-event-connection.js - About 1 hr to fix

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

                                      (LoginModel, LoginService, UserService, ClientStorageService, $state, $window, $stateParams, $location) => {
                                        let vm = GenericController(
                                          LoginModel,
                                          {
                                            onSubmit: data => new LoginModel(new EmailValue(data.email), data.password),
                          Severity: Minor
                          Found in js/controller/login.js - About 1 hr to fix

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

                            export function AdminController (app) {
                              app
                                .config(['$stateProvider', ($stateProvider) => {
                                  $stateProvider
                                    .state('admin', {
                            Severity: Minor
                            Found in js/controller/admin.js - About 1 hr to fix

                              Function ActivationController has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function ActivationController (app) {
                                app
                                  .config(['$stateProvider', ($stateProvider) => {
                                    $stateProvider
                                      .state('activation', {
                              Severity: Minor
                              Found in js/controller/activation.js - About 1 hr to fix

                                Function AdminUserController has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function AdminUserController ($rootScope, $timeout, $stateParams, IDService, ClientStorageService, UserService) {
                                  const self = this
                                  self.user = false
                                  self.userCopy = false
                                  self.p = new HttpProgress()
                                Severity: Minor
                                Found in js/controller/admin-user.js - 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 AccountProfileController has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function AccountProfileController ($rootScope, $timeout, ClientStorageService, UserService) {
                                  const self = this
                                  self.user = false
                                  self.userCopy = false
                                  self.p = new HttpProgress()
                                Severity: Minor
                                Found in js/controller/account-profile.js - 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

                                Severity
                                Category
                                Status
                                Source
                                Language