insideout10/wordlift-plugin-js

View on GitHub
app/js/wordlift.js

Summary

Maintainability
F
2 wks
Test Coverage

File wordlift.js has 1481 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function() {
  var $, $wlEntityDisplayAsSelect, ANALYSIS_EVENT, CONFIGURATION_TYPES_EVENT, CONTENT_EDITABLE, CONTENT_IFRAME, CONTEXT, DBPEDIA, DBPEDIA_ORG, DBPEDIA_ORG_REGEX, DCTERMS, DEFAULT_ENTITY_ANNOTATION_CONFIDENCE_LEVEL, EDITOR_ID, FISE_ONT, FISE_ONT_CONFIDENCE, FISE_ONT_ENTITY_ANNOTATION, FISE_ONT_TEXT_ANNOTATION, FREEBASE, FREEBASE_COM, FREEBASE_NS, FREEBASE_NS_DESCRIPTION, GRAPH, MCE_WORDLIFT, RDFS, RDFS_COMMENT, RDFS_LABEL, RUNNING_CLASS, SCHEMA_ORG, SCHEMA_ORG_DESCRIPTION, TEXT_ANNOTATION, TEXT_HTML_NODE_TYPE, Traslator, VALUE, WGS84_POS, WORDLIFT, container, injector,
    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

  Traslator = (function() {
Severity: Major
Found in app/js/wordlift.js - About 3 days to fix

    Function parse has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          service.parse = function(data, merge) {
            var anotherEntityAnnotation, anotherId, context, createLanguage, dctype, entities, entity, entityAnnotation, entityAnnotations, graph, id, item, language, languages, textAnnotation, textAnnotationId, textAnnotations, types, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3;
            if (merge == null) {
              merge = false;
            }
    Severity: Major
    Found in app/js/wordlift.js - About 4 hrs to fix

      Function create has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            service.create = function(item, language, kt, context) {
              var css, entity, fn, id, knownTypes, sameAs, thumbnails, types;
              id = h.get('@id', item, context);
              types = h.get('@type', item, context, function(ts) {
                var t, _i, _len, _results;
      Severity: Major
      Found in app/js/wordlift.js - About 2 hrs to fix

        Function embedAnalysis has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                embedAnalysis: (function(_this) {
                  return function(analysis) {
                    var ed, element, entities, entity, entityAnnotations, html, isDirty, textAnnotation, textAnnotationId, traslator, _ref;
                    ed = editor();
                    html = ed.getContent({
        Severity: Minor
        Found in app/js/wordlift.js - About 1 hr to fix

          Function link has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  link: function(originalScope, elem, attrs, ctrl) {
                    var templateHtml;
                    templateHtml = '<wl-entity on-select="select(entityAnnotation)" entity-annotation="entityAnnotation"></wl-entity>';
                    return elem.autocomplete({
                      source: function(request, response) {
          Severity: Minor
          Found in app/js/wordlift.js - About 1 hr to fix

            Function preselect has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  service.preselect = function(analysis, annotations) {
                    var annotation, ea, entities, entityAnnotations, textAnnotation, _i, _len, _results;
                    _results = [];
                    for (_i = 0, _len = annotations.length; _i < _len; _i++) {
                      annotation = annotations[_i];
            Severity: Minor
            Found in app/js/wordlift.js - About 1 hr to fix

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

                    service.getKnownTypes = function(types, knownTypes, context) {
                      var defaultType, kt, matches, returnTypes, uri, uris, _i, _len;
                      returnTypes = [];
                      defaultType = void 0;
                      for (_i = 0, _len = knownTypes.length; _i < _len; _i++) {
              Severity: Minor
              Found in app/js/wordlift.js - About 1 hr to fix

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

                    Traslator.prototype.parse = function() {
                      var htmlElem, htmlLength, htmlPost, htmlPre, htmlProcessed, match, pattern, textLength, textPost, textPre;
                      this._htmlPositions = [];
                      this._textPositions = [];
                      this._text = '';
                Severity: Minor
                Found in app/js/wordlift.js - About 1 hr to fix

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

                        service.merge = function(entity, entities) {
                          var existing, sameAs, _i, _len, _ref;
                          _ref = entity.sameAs;
                          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                            sameAs = _ref[_i];
                  Severity: Minor
                  Found in app/js/wordlift.js - About 1 hr to fix

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

                          service.find = function(entityAnnotations, filter) {
                            var entityAnnotation, id;
                            if (filter.uri != null) {
                              return (function() {
                                var _ref, _results;
                    Severity: Minor
                    Found in app/js/wordlift.js - About 1 hr to fix

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

                              createDefaultAnalysis: function() {
                                var analysis, ea, ed, entities, html, inTextEntity, localEntities, ta, _i, _len, _ref;
                                ed = editor();
                                html = ed.getContent({
                                  format: 'raw'
                      Severity: Minor
                      Found in app/js/wordlift.js - About 1 hr to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        if (id !== anotherId && entityAnnotation.entity === anotherEntityAnnotation.entity) {
                                          delete textAnnotation.entityAnnotations[anotherId];
                                        }
                        Severity: Major
                        Found in app/js/wordlift.js - About 45 mins to fix

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

                                service.build = function(item, language, entities, tas, context) {
                          Severity: Minor
                          Found in app/js/wordlift.js - About 35 mins to fix

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

                              Traslator = (function() {
                                var decodeHtml;
                            
                                Traslator.prototype._htmlPositions = [];
                            
                            
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 1 wk to fix
                            app/js/wordlift-reloaded.js on lines 5..120

                            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 1210.

                            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

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

                                  service.uniqueId = function(length) {
                                    var id;
                                    if (length == null) {
                                      length = 8;
                                    }
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 3 hrs to fix
                            app/js/wordlift-reloaded.js on lines 617..627

                            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 95.

                            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

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

                                __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 2 hrs to fix
                            app/js/wordlift-reloaded.js on lines 3..3

                            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 80.

                            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

                                  service.find = function(textAnnotations, start, end) {
                                    var textAnnotation, textAnnotationId;
                                    for (textAnnotationId in textAnnotations) {
                                      textAnnotation = textAnnotations[textAnnotationId];
                                      if (textAnnotation.start === start && textAnnotation.end === end) {
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 1 hr to fix
                            app/js/wordlift-reloaded.js on lines 639..647

                            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 68.

                            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

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

                                      _results.push({
                                        start: traslator.html2text(match.index),
                                        end: traslator.html2text(match.index + match[0].length),
                                        uri: match[2],
                                        label: match[3]
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 1 hr to fix
                            app/js/wordlift-reloaded.js on lines 922..927

                            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 66.

                            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

                                        top: $(CONTENT_IFRAME).offset().top - $('body').scrollTop() + textAnnotationPos.y - $(ed.getBody()).scrollTop(),
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 1 hr to fix
                            app/js/wordlift.js on lines 730..730

                            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

                                        left: $(CONTENT_IFRAME).offset().left - $('body').scrollLeft() + textAnnotationPos.x - $(ed.getBody()).scrollLeft()
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 1 hr to fix
                            app/js/wordlift.js on lines 729..729

                            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

                                        for (_i = 0, _len = content.length; _i < _len; _i++) {
                                          c = content[_i];
                                          _results.push(service.expand(c, context));
                                        }
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 1 hr to fix
                            app/js/wordlift.js on lines 936..939

                            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 63.

                            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

                                      for (_i = 0, _len = ts.length; _i < _len; _i++) {
                                        t = ts[_i];
                                        _results.push(h.expand(t, context));
                                      }
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 1 hr to fix
                            app/js/wordlift.js on lines 1169..1172

                            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 63.

                            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

                                      scope.startDate = (_ref = scope.entity) != null ? (_ref1 = _ref.props['http://www.w3.org/2002/12/cal#dtstart']) != null ? _ref1[0] : void 0 : void 0;
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 1 hr to fix
                            app/js/wordlift.js on lines 250..250

                            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 59.

                            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

                                      scope.endDate = (_ref2 = scope.entity) != null ? (_ref3 = _ref2.props['http://www.w3.org/2002/12/cal#dtend']) != null ? _ref3[0] : void 0 : void 0;
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 1 hr to fix
                            app/js/wordlift.js on lines 249..249

                            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 59.

                            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

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

                                    if (AnalysisService.enhance($scope.analysis, $scope.textAnnotation, entityAnnotation) === true) {
                                      return $scope.$emit('selectEntity', {
                                        ta: $scope.textAnnotation,
                                        ea: entityAnnotation
                                      });
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 1 hr to fix
                            app/js/wordlift.js on lines 1432..1437

                            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 56.

                            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

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

                                      if (AnalysisService.enhance($scope.analysis, $scope.textAnnotation, entityAnnotation) === true) {
                                        return $scope.$emit('selectEntity', {
                                          ta: $scope.textAnnotation,
                                          ea: entityAnnotation
                                        });
                            Severity: Major
                            Found in app/js/wordlift.js and 1 other location - About 1 hr to fix
                            app/js/wordlift.js on lines 1444..1449

                            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 56.

                            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

                              angular.module('wordlift.directives.wlEntityProps', []).directive('wlEntityProps', function() {
                                return {
                                  restrict: 'E',
                                  scope: {
                                    textAnnotations: '='
                            Severity: Minor
                            Found in app/js/wordlift.js and 1 other location - About 50 mins to fix
                            app/js/wordlift-reloaded.js on lines 604..612

                            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 52.

                            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

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

                                  service.extend = function(object, properties) {
                                    var key, val;
                                    for (key in properties) {
                                      val = properties[key];
                                      object[key] = val;
                            Severity: Minor
                            Found in app/js/wordlift.js and 1 other location - About 50 mins to fix
                            app/js/wordlift-reloaded.js on lines 631..638

                            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 51.

                            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

                            There are no issues that match your filters.

                            Category
                            Status