instructure/lti_public_resources

View on GitHub

Showing 30 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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    module.exports = {
      "test": {
        options: {
          bare: true
        },
    Severity: Major
    Found in ember-app/tasks/options/coffee.js and 1 other location - About 4 hrs to fix
    ember-app/tasks/options/emberscript.js on lines 17..42

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 128.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    module.exports = {
      "test": {
        options: {
          bare: true
        },
    Severity: Major
    Found in ember-app/tasks/options/emberscript.js and 1 other location - About 4 hrs to fix
    ember-app/tasks/options/coffee.js on lines 17..42

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 128.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

                case 'iframe':
                  ret = ReturnTypeIframe.create(rt);
                  if (Em.ENV.RETURN_TYPES.contains('iframe')) {
                    ret.set('returnable', true);
                  }
        Severity: Major
        Found in ember-app/app/libs/response-type.js and 3 other locations - About 1 hr to fix
        ember-app/app/libs/response-type.js on lines 65..71
        ember-app/app/libs/response-type.js on lines 72..78
        ember-app/app/libs/response-type.js on lines 79..85

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 74.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

                case 'image_url':
                  ret = ReturnTypeImageUrl.create(rt);
                  if (Em.ENV.RETURN_TYPES.contains('image_url')) {
                    ret.set('returnable', true);
                  }
        Severity: Major
        Found in ember-app/app/libs/response-type.js and 3 other locations - About 1 hr to fix
        ember-app/app/libs/response-type.js on lines 58..64
        ember-app/app/libs/response-type.js on lines 72..78
        ember-app/app/libs/response-type.js on lines 79..85

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 74.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

                case 'oembed':
                  ret = ReturnTypeOembed.create(rt);
                  if (Em.ENV.RETURN_TYPES.contains('oembed')) {
                    ret.set('returnable', true);
                  }
        Severity: Major
        Found in ember-app/app/libs/response-type.js and 3 other locations - About 1 hr to fix
        ember-app/app/libs/response-type.js on lines 58..64
        ember-app/app/libs/response-type.js on lines 65..71
        ember-app/app/libs/response-type.js on lines 79..85

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 74.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

                case 'file':
                  ret = ReturnTypeFile.create(rt);
                  if (Em.ENV.RETURN_TYPES.contains('file')) {
                    ret.set('returnable', true);
                  }
        Severity: Major
        Found in ember-app/app/libs/response-type.js and 3 other locations - About 1 hr to fix
        ember-app/app/libs/response-type.js on lines 58..64
        ember-app/app/libs/response-type.js on lines 65..71
        ember-app/app/libs/response-type.js on lines 72..78

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 74.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          export default ReturnType.extend({
            returnType : 'imageUrl',
            url        : null,
            title      : null,
            width      : null,
          Severity: Major
          Found in ember-app/app/libs/return_types/image-url.js and 1 other location - About 1 hr to fix
          ember-app/app/libs/return_types/url.js on lines 3..15

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 71.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            export default ReturnType.extend({
              returnType : 'url',
              url        : null,
              text       : null,
              title      : null,
            Severity: Major
            Found in ember-app/app/libs/return_types/url.js and 1 other location - About 1 hr to fix
            ember-app/app/libs/return_types/image-url.js on lines 3..16

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 71.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              "app": {
                type: 'amd',
                moduleName: function(path) {
                  return grunt.config.process('<%= package.namespace %>/') + path;
                },
            Severity: Major
            Found in ember-app/tasks/options/transpile.js and 1 other location - About 1 hr to fix
            ember-app/tasks/options/transpile.js on lines 4..15

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 69.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              "tests": {
                type: 'amd',
                moduleName: function(path) {
                  return grunt.config.process('<%= package.namespace %>/tests/') + path;
                },
            Severity: Major
            Found in ember-app/tasks/options/transpile.js and 1 other location - About 1 hr to fix
            ember-app/tasks/options/transpile.js on lines 16..27

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 69.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  src = '<iframe src="' + this.get('embedUrl') + '" width="' + this.get('width') + '" height="' + this.get('height') + '" title="' + this.get('title') + '" frameborder="0" allowfullscreen></iframe>';
              Severity: Major
              Found in ember-app/app/libs/response_types/video.js and 1 other location - About 1 hr to fix
              ember-app/app/libs/return_types/iframe.js on lines 11..11

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 65.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  return '<iframe src="' + this.get('url') + '" width="' + this.get('width') + '" height="' + this.get('height') + '" title="' + this.get('title') + '" frameborder="0" allowfullscreen></iframe>';
              Severity: Major
              Found in ember-app/app/libs/return_types/iframe.js and 1 other location - About 1 hr to fix
              ember-app/app/libs/response_types/video.js on lines 38..38

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 65.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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
                Severity
                Category
                Status
                Source
                Language