greenelab/adage-server

View on GitHub
interface/src/app/tribe_client/directives.js

Summary

Maintainability
A
2 hrs
Test Coverage

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

        function($scope, UserFactory, $uibModal, $rootScope, $window) {
          UserFactory.getPromise().then(function() {
            $scope.userObj = UserFactory.getUser();
          });

Severity: Minor
Found in interface/src/app/tribe_client/directives.js - About 1 hr to fix

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

              $scope.openLoginModal = function() {
                var modalInstance = $uibModal.open({
                  templateUrl: 'tribe_client/tribe-login-modal.tpl.html',
                  controller: [
                    '$scope', '$uibModalInstance', 'TribeSettings',
    Severity: Minor
    Found in interface/src/app/tribe_client/directives.js - About 1 hr to fix

      Function controller has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              function($scope, UserFactory, $uibModal, $rootScope, $window) {
      Severity: Minor
      Found in interface/src/app/tribe_client/directives.js - About 35 mins to fix

        Identifier 'tribe_url' is not in camel case.
        Open

                            $scope.tribe_url = data['tribe_url'];

        Require Camelcase (camelcase)

        When it comes to naming variables, style guides generally fall into one of two camps: camelcase (variableName) and underscores (variable_name). This rule focuses on using the camelcase approach. If your style guide calls for camelcasing your variable names, then this rule is for you!

        Rule Details

        This rule looks for any underscores (_) located within the source code. It ignores leading and trailing underscores and only checks those in the middle of a variable name. If ESLint decides that the variable is a constant (all uppercase), then no warning will be thrown. Otherwise, a warning will be thrown. This rule only flags definitions and assignments but not function calls. In case of ES6 import statements, this rule only targets the name of the variable that will be imported into the local module scope.

        Options

        This rule has an object option:

        • "properties": "always" (default) enforces camelcase style for property names
        • "properties": "never" does not check property names

        always

        Examples of incorrect code for this rule with the default { "properties": "always" } option:

        /*eslint camelcase: "error"*/
        
        import { no_camelcased } from "external-module"
        
        var my_favorite_color = "#112C85";
        
        function do_something() {
            // ...
        }
        
        obj.do_something = function() {
            // ...
        };
        
        var obj = {
            my_pref: 1
        };

        Examples of correct code for this rule with the default { "properties": "always" } option:

        /*eslint camelcase: "error"*/
        
        import { no_camelcased as camelCased } from "external-module";
        
        var myFavoriteColor   = "#112C85";
        var _myFavoriteColor  = "#112C85";
        var myFavoriteColor_  = "#112C85";
        var MY_FAVORITE_COLOR = "#112C85";
        var foo = bar.baz_boom;
        var foo = { qux: bar.baz_boom };
        
        obj.do_something();
        do_something();
        new do_something();
        
        var { category_id: category } = query;

        never

        Examples of correct code for this rule with the { "properties": "never" } option:

        /*eslint camelcase: ["error", {properties: "never"}]*/
        
        var obj = {
            my_pref: 1
        };

        When Not To Use It

        If you have established coding standards using a different naming convention (separating words with underscores), turn this rule off. Source: http://eslint.org/docs/rules/

        Identifier 'tribe_scope' is not in camel case.
        Open

                            $scope.tribe_scope = data['scope'];

        Require Camelcase (camelcase)

        When it comes to naming variables, style guides generally fall into one of two camps: camelcase (variableName) and underscores (variable_name). This rule focuses on using the camelcase approach. If your style guide calls for camelcasing your variable names, then this rule is for you!

        Rule Details

        This rule looks for any underscores (_) located within the source code. It ignores leading and trailing underscores and only checks those in the middle of a variable name. If ESLint decides that the variable is a constant (all uppercase), then no warning will be thrown. Otherwise, a warning will be thrown. This rule only flags definitions and assignments but not function calls. In case of ES6 import statements, this rule only targets the name of the variable that will be imported into the local module scope.

        Options

        This rule has an object option:

        • "properties": "always" (default) enforces camelcase style for property names
        • "properties": "never" does not check property names

        always

        Examples of incorrect code for this rule with the default { "properties": "always" } option:

        /*eslint camelcase: "error"*/
        
        import { no_camelcased } from "external-module"
        
        var my_favorite_color = "#112C85";
        
        function do_something() {
            // ...
        }
        
        obj.do_something = function() {
            // ...
        };
        
        var obj = {
            my_pref: 1
        };

        Examples of correct code for this rule with the default { "properties": "always" } option:

        /*eslint camelcase: "error"*/
        
        import { no_camelcased as camelCased } from "external-module";
        
        var myFavoriteColor   = "#112C85";
        var _myFavoriteColor  = "#112C85";
        var myFavoriteColor_  = "#112C85";
        var MY_FAVORITE_COLOR = "#112C85";
        var foo = bar.baz_boom;
        var foo = { qux: bar.baz_boom };
        
        obj.do_something();
        do_something();
        new do_something();
        
        var { category_id: category } = query;

        never

        Examples of correct code for this rule with the { "properties": "never" } option:

        /*eslint camelcase: ["error", {properties: "never"}]*/
        
        var obj = {
            my_pref: 1
        };

        When Not To Use It

        If you have established coding standards using a different naming convention (separating words with underscores), turn this rule off. Source: http://eslint.org/docs/rules/

        Identifier 'client_id' is not in camel case.
        Open

                            $scope.client_id = data['client_id'];

        Require Camelcase (camelcase)

        When it comes to naming variables, style guides generally fall into one of two camps: camelcase (variableName) and underscores (variable_name). This rule focuses on using the camelcase approach. If your style guide calls for camelcasing your variable names, then this rule is for you!

        Rule Details

        This rule looks for any underscores (_) located within the source code. It ignores leading and trailing underscores and only checks those in the middle of a variable name. If ESLint decides that the variable is a constant (all uppercase), then no warning will be thrown. Otherwise, a warning will be thrown. This rule only flags definitions and assignments but not function calls. In case of ES6 import statements, this rule only targets the name of the variable that will be imported into the local module scope.

        Options

        This rule has an object option:

        • "properties": "always" (default) enforces camelcase style for property names
        • "properties": "never" does not check property names

        always

        Examples of incorrect code for this rule with the default { "properties": "always" } option:

        /*eslint camelcase: "error"*/
        
        import { no_camelcased } from "external-module"
        
        var my_favorite_color = "#112C85";
        
        function do_something() {
            // ...
        }
        
        obj.do_something = function() {
            // ...
        };
        
        var obj = {
            my_pref: 1
        };

        Examples of correct code for this rule with the default { "properties": "always" } option:

        /*eslint camelcase: "error"*/
        
        import { no_camelcased as camelCased } from "external-module";
        
        var myFavoriteColor   = "#112C85";
        var _myFavoriteColor  = "#112C85";
        var myFavoriteColor_  = "#112C85";
        var MY_FAVORITE_COLOR = "#112C85";
        var foo = bar.baz_boom;
        var foo = { qux: bar.baz_boom };
        
        obj.do_something();
        do_something();
        new do_something();
        
        var { category_id: category } = query;

        never

        Examples of correct code for this rule with the { "properties": "never" } option:

        /*eslint camelcase: ["error", {properties: "never"}]*/
        
        var obj = {
            my_pref: 1
        };

        When Not To Use It

        If you have established coding standards using a different naming convention (separating words with underscores), turn this rule off. Source: http://eslint.org/docs/rules/

        Identifier 'access_code_url' is not in camel case.
        Open

                            $scope.access_code_url = data['access_code_url'];

        Require Camelcase (camelcase)

        When it comes to naming variables, style guides generally fall into one of two camps: camelcase (variableName) and underscores (variable_name). This rule focuses on using the camelcase approach. If your style guide calls for camelcasing your variable names, then this rule is for you!

        Rule Details

        This rule looks for any underscores (_) located within the source code. It ignores leading and trailing underscores and only checks those in the middle of a variable name. If ESLint decides that the variable is a constant (all uppercase), then no warning will be thrown. Otherwise, a warning will be thrown. This rule only flags definitions and assignments but not function calls. In case of ES6 import statements, this rule only targets the name of the variable that will be imported into the local module scope.

        Options

        This rule has an object option:

        • "properties": "always" (default) enforces camelcase style for property names
        • "properties": "never" does not check property names

        always

        Examples of incorrect code for this rule with the default { "properties": "always" } option:

        /*eslint camelcase: "error"*/
        
        import { no_camelcased } from "external-module"
        
        var my_favorite_color = "#112C85";
        
        function do_something() {
            // ...
        }
        
        obj.do_something = function() {
            // ...
        };
        
        var obj = {
            my_pref: 1
        };

        Examples of correct code for this rule with the default { "properties": "always" } option:

        /*eslint camelcase: "error"*/
        
        import { no_camelcased as camelCased } from "external-module";
        
        var myFavoriteColor   = "#112C85";
        var _myFavoriteColor  = "#112C85";
        var myFavoriteColor_  = "#112C85";
        var MY_FAVORITE_COLOR = "#112C85";
        var foo = bar.baz_boom;
        var foo = { qux: bar.baz_boom };
        
        obj.do_something();
        do_something();
        new do_something();
        
        var { category_id: category } = query;

        never

        Examples of correct code for this rule with the { "properties": "never" } option:

        /*eslint camelcase: ["error", {properties: "never"}]*/
        
        var obj = {
            my_pref: 1
        };

        When Not To Use It

        If you have established coding standards using a different naming convention (separating words with underscores), turn this rule off. Source: http://eslint.org/docs/rules/

        There are no issues that match your filters.

        Category
        Status