Thibau/datalift-datacubeviz

View on GitHub

Showing 73 of 73 total issues

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

      $.getJSON(endpointURL + encodeURIComponent(endpoint.query.observations(datasetURI)),
        function (data) {
          var observationFactory = new ObservationFactory();
          self.currentObservations(observationFactory.build(data.results.bindings));
        }
Severity: Major
Found in datacubeviz/src/web/public/static/js/viewmodels/explorer.js and 1 other location - About 2 hrs to fix
datacubeviz/src/web/public/static/js/viewmodels/explorer.js on lines 82..87

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

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

      $.getJSON(endpointURL + encodeURIComponent(endpoint.query.components(datasetURI)),
        function (data) {
          var componentFactory = new ComponentFactory();
          self.currentComponents(componentFactory.build(data.results.bindings));
        }
Severity: Major
Found in datacubeviz/src/web/public/static/js/viewmodels/explorer.js and 1 other location - About 2 hrs to fix
datacubeviz/src/web/public/static/js/viewmodels/explorer.js on lines 75..80

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

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 build has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    self.build = function (bindings) {
      var rawDatasets = {};
      var current, uri;

      // A dataset can have (often has) multiple bindings.

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

      , slide: function (type, next) {
          var $active = this.$element.find('.item.active')
            , $next = next || $active[type]()
            , isCycling = this.interval
            , direction = type == 'next' ? 'left' : 'right'
    Severity: Minor
    Found in datacubeviz/src/web/public/static/js/libs/bootstrap-2.3.0.min.js - About 1 hr to fix

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

            var $this = $(this)
              , data = $this.data('modal')
              , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
      datacubeviz/src/web/public/static/js/libs/bootstrap-2.3.0.min.js on lines 597..599

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

      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

            var $this = $(this)
              , data = $this.data('collapse')
              , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
      datacubeviz/src/web/public/static/js/libs/bootstrap-2.3.0.min.js on lines 1000..1002

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

      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 show has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        , show: function () {
            var $tip
              , pos
              , actualWidth
              , actualHeight
      Severity: Minor
      Found in datacubeviz/src/web/public/static/js/libs/bootstrap-2.3.0.min.js - About 1 hr to fix

        Function fnUpdate has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              "fnUpdate": function ( oSettings, fnDraw ) {
                var iListLength = 5;
                var oPaging = oSettings.oInstance.fnPagingInfo();
                var an = oSettings.aanFeatures.p;
                var i, ien, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);

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

                update: function (element, valueAccessor) {
                  var binding = ko.utils.unwrapObservable(valueAccessor());
          
                  if (binding) {
                    var data = function() {
          Severity: Minor
          Found in datacubeviz/src/web/public/static/js/extends/nvd3-handlers.js - About 1 hr to fix

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

                    if (binding.origin && current.origin.indexOf(binding.origin.value) === -1) {
                      current.origin.push(binding.origin.value);
                    }
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 66..68
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 69..71
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 75..77

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

            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

                    if (binding.subject && current.subjects.indexOf(binding.subject.value) === -1) {
                      current.subjects.push(binding.subject.value);
                    }
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 69..71
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 72..74
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 75..77

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

            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

                    if (binding.subjectLabel && current.subjects.indexOf(binding.subjectLabel.value) === -1) {
                      current.subjects.push(binding.subjectLabel.value);
                    }
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 66..68
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 72..74
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 75..77

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

            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

                    if (binding.license && current.license.indexOf(binding.license.value) === -1) {
                      current.license.push(binding.license.value);
                    }
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 66..68
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 69..71
            datacubeviz/src/web/public/static/js/models/factories/DatasetFactory.js on lines 72..74

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

            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

                      $.support.transition && this.$element.hasClass('fade')?
                        this.$backdrop.one($.support.transition.end, callback) :
                        callback()
            datacubeviz/src/web/public/static/js/libs/bootstrap-2.3.0.min.js on lines 578..580

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

            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

                  $.support.transition && this.$element.hasClass('collapse') ?
                    this.$element.one($.support.transition.end, complete) :
                    complete()
            datacubeviz/src/web/public/static/js/libs/bootstrap-2.3.0.min.js on lines 982..984

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

            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 applyPlacement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              , applyPlacement: function(offset, placement){
                  var $tip = this.tip()
                    , width = $tip[0].offsetWidth
                    , height = $tip[0].offsetHeight
                    , actualWidth
            Severity: Minor
            Found in datacubeviz/src/web/public/static/js/libs/bootstrap-2.3.0.min.js - About 1 hr to fix

              Method canHandle has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  public UriDesc canHandle(Project p) {
                      UriDesc projectPage = null;
                      // The project can be handled if it has at least one datacube
                      // source.

              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 getDatasets has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public TupleQueryResult getDatasets(Source src) {
                      TupleQueryResult rs = null;
                      if (src instanceof TransformedRdfSource) {
                          try {
                              TransformedRdfSource rdf = (TransformedRdfSource) src;
              Severity: Minor
              Found in datacubeviz/src/java/org/datalift/datacubeviz/DatacubeVizModel.java - About 1 hr to fix

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

                  , keydown: function (e) {
                      var $this
                        , $items
                        , $active
                        , $parent
                Severity: Minor
                Found in datacubeviz/src/web/public/static/js/libs/bootstrap-2.3.0.min.js - About 1 hr to fix

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

                      init: function (element, valueAccessor) {
                        var value = ko.utils.unwrapObservable(valueAccessor());
                        $(element).tooltip({
                          title: value
                        });
                  Severity: Major
                  Found in datacubeviz/src/web/public/static/js/extends/handlers.js and 1 other location - About 1 hr to fix
                  datacubeviz/src/web/public/static/js/extends/handlers.js on lines 75..80

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language