aymerick/kowa-client

View on GitHub

Showing 12 of 87 total issues

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

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    // // needed since ember 1.10.0
    // // cf. https://github.com/rwjblue/components-in-subdirs/commit/78e7ed2d072f42d9cf0fd3d9fc2376f106ab762e
    // vendorFiles: {
Severity: Major
Found in ember-cli-build.js - About 2 hrs to fix

    File translations.js has 261 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export default {
      // common
      cancel: 'Annuler',
      chooseImage: 'Choisir image',
      close: 'Fermer',
    Severity: Minor
    Found in app/locales/fr/translations.js - About 2 hrs to fix

      File translations.js has 259 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      export default {
        // common
        cancel: 'Cancel',
        chooseImage: 'Choose image',
        close: 'Close',
      Severity: Minor
      Found in app/locales/en/translations.js - About 2 hrs to fix

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

          initEditor: function() {
            var settings = {
              theme_url: '/tinymce/themes/modern/theme.min.js',
              skin_url: '/tinymce/skins/lightgray',
              external_plugins: {
        Severity: Minor
        Found in app/components/tinymce-editor.js - About 1 hr to fix

          Function setUnknownProperty has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            setUnknownProperty: function(key, value){
              var prop;
              var ckey;
              if(key.indexOf("textField") === 0) {
          
          
          Severity: Minor
          Found in app/components/bs-datetimepicker.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 _initDatepicker has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _initDatepicker: Ember.on('didInsertElement', function() {
              var target;
              var self = this;
              if (this.get('noIcon')) {
                var targetClassNames = '.'+ this.get('textFieldClassNames').join('.');
          Severity: Minor
          Found in app/components/bs-datetimepicker.js - About 1 hr to fix

            Function initialize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              initialize: function (container) {
                // custom session class
                container.register('session:kowa', AuthSession);
            
                // SimpleAuth
            Severity: Minor
            Found in app/initializers/authentication.js - About 1 hr to fix

              Function default has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function(){
                // settings.contact
                this.transition(
                  this.fromRoute('settings.contact.index'),
                  this.toRoute('settings.contact.page'),
              Severity: Minor
              Found in app/transitions.js - About 1 hr to fix

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

                  setUnknownProperty: function(key, value){
                    var prop;
                    var ckey;
                    if(key.indexOf("textField") === 0) {
                
                
                Severity: Minor
                Found in app/components/bs-datetimepicker.js - About 1 hr to fix

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

                      uploadImage: function(file, index) {
                        var job = new UploadJob({
                          url: this.get('uploadUrl'),
                          file: file
                        });
                  Severity: Minor
                  Found in app/controllers/settings/images.js - About 1 hr to fix

                    Avoid too many return statements within this function.
                    Open

                        return statusResult;
                    Severity: Major
                    Found in app/controllers/posts.js - About 30 mins to fix

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

                        orderBy: function (item1, item2) {
                          var updated1 = item1.get('updatedAt'),
                              updated2 = item2.get('updatedAt');
                      
                          if (item1.get('isNew') || !updated1) {
                      Severity: Minor
                      Found in app/controllers/posts.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