instructure/lti_public_resources

View on GitHub

Showing 10 of 30 total issues

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

module.exports = function(grunt) {
  // To support Coffeescript, SASS, LESS and others, just install
  // the appropriate grunt package and it will be automatically included
  // in the build process:
  //
Severity: Major
Found in ember-app/Gruntfile.js - About 6 hrs to fix

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

    module.exports = function(grunt) {
      var express = require('express'),
          lockFile = require('lockfile'),
          Helpers = require('./helpers'),
          fs = require('fs'),
    Severity: Major
    Found in ember-app/tasks/express-server.js - About 2 hrs to fix

      Function findFolder has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        findFolder: function(toolId, folder, parentFolderChain) {
          var browsable, folderChain, url;
          url = Ember.ENV.CONFIG.host + '/api/browse';
          browsable = Browsable.create({});
          folderChain = parentFolderChain + '.' + folder;
      Severity: Major
      Found in ember-app/app/libs/browsable.js - About 2 hrs to fix

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

        module.exports = function(config) {
          config.set({
        
            // list of files / patterns to load in the browser
            files: [
        Severity: Minor
        Found in ember-app/karma.conf.js - About 1 hr to fix

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

            addReturnTypes: function(rts) {
              var _this = this,
                  ret = null,
                  acceptLtiLaunchUrl = Em.ENV.RETURN_TYPES.contains('lti_launch_url');
          
          
          Severity: Minor
          Found in ember-app/app/libs/response-type.js - About 1 hr to fix

            Function exports has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = function(grunt) {
              var express = require('express'),
                  lockFile = require('lockfile'),
                  Helpers = require('./helpers'),
                  fs = require('fs'),
            Severity: Minor
            Found in ember-app/tasks/express-server.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

            Method apps has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def self.apps
                {
                  youtube: {
                    name: "YouTube",
                    description: "Search publicly available YouTube videos. A new icon will show up in your course rich editor letting you search YouTube and click to embed videos in your course material.",
            Severity: Minor
            Found in lib/lti_public_resources.rb - About 1 hr to fix

              Method xml_config has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def xml_config
                    script_name = request.env['SCRIPT_NAME']
                    host = request.scheme + "://" + request.host_with_port
                    tool_id = 'public_resources'
              
              
              Severity: Minor
              Found in app/controllers/lti_public_resources/api_controller.rb - About 1 hr to fix

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

                  parseResults: function(results) {
                    var _this = this;
                    this.set('nextCriteria', results.get('next_criteria'));
                    this.set('performedSearch', true);
                
                
                Severity: Minor
                Found in ember-app/app/controllers/lti-app/search/results.js - About 1 hr to fix

                  Function getJson has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                    getJson: function() {
                      var v, key, ret;
                      ret = [];
                      for (key in this) {
                        if (this.hasOwnProperty(key)) {
                  Severity: Minor
                  Found in ember-app/app/mixins/jsonable.js - About 55 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