privly/privly-applications

View on GitHub

Showing 109 of 109 total issues

Function contentReturned has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  contentReturned: function(response, callback) {
    if( response.jqXHR.status === 200 ) {
      
      var json = response.json;
      
Severity: Major
Found in shared/javascripts/viewAdapters/show.js - About 2 hrs to fix

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

      NewAdapter.prototype.postprocessLink = function (link) {
        var promise;
        if (typeof this.application.postprocessLink === 'function') {
          promise = this.application.postprocessLink(link);
        } else {
    Severity: Major
    Found in shared/javascripts/viewAdapters/new.js and 1 other location - About 2 hrs to fix
    shared/javascripts/viewAdapters/seamless.js on lines 401..409

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

    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

      SeamlessAdapter.prototype.postprocessLink = function (link) {
        var promise;
        if (typeof this.application.postprocessLink === 'function') {
          promise = this.application.postprocessLink(link);
        } else {
    Severity: Major
    Found in shared/javascripts/viewAdapters/seamless.js and 1 other location - About 2 hrs to fix
    shared/javascripts/viewAdapters/new.js on lines 213..221

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

    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

      SeamlessAdapter.prototype.getTTLOptions = function () {
        var promise;
        if (typeof this.application.getTTLOptions === 'function') {
          promise = this.application.getTTLOptions();
        } else {
    Severity: Major
    Found in shared/javascripts/viewAdapters/seamless.js and 1 other location - About 2 hrs to fix
    shared/javascripts/viewAdapters/seamless_ttlselect.js on lines 103..111

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

    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

      SeamlessTTLSelectAdapter.prototype.getTTLOptions = function () {
        var promise;
        if (typeof this.application.getTTLOptions === 'function') {
          promise = this.application.getTTLOptions();
        } else {
    Severity: Major
    Found in shared/javascripts/viewAdapters/seamless_ttlselect.js and 1 other location - About 2 hrs to fix
    shared/javascripts/viewAdapters/seamless.js on lines 419..427

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

    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

    File network_service.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * @fileOverview Interfaces the application with its current architecture.
     * This could be an extension, mobile app, or a hosted web server.
     *
     **/
    Severity: Minor
    Found in shared/javascripts/network_service.js - About 2 hrs to fix

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

          if (window.location.search.indexOf('?') === 0) {
            var query = privlyParameters.parameterStringToHash(window.location.search.substr(1));
            this.sourceContextId = query.contextid;
            this.sourceResourceId = query.resid;
            this.selfAppId = query.appid;
      Severity: Major
      Found in shared/javascripts/viewAdapters/seamless.js and 1 other location - About 2 hrs to fix
      shared/javascripts/viewAdapters/seamless_ttlselect.js on lines 41..46

      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

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

          if (window.location.search.indexOf('?') === 0) {
            var query = privlyParameters.parameterStringToHash(window.location.search.substr(1));
            this.sourceContextId = query.contextid;
            this.sourceResourceId = query.resid;
            this.selfAppId = query.appid;
      Severity: Major
      Found in shared/javascripts/viewAdapters/seamless_ttlselect.js and 1 other location - About 2 hrs to fix
      shared/javascripts/viewAdapters/seamless.js on lines 116..121

      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

      Function getMessageDOM has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getMessageDOM(row) {
        var href = row.privly_URL;
        var app = row.privly_application;
      
        // Rename deperecated apps - TODO Will be removed soon
      Severity: Major
      Found in History/js/new.js - About 2 hrs to fix

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

        document.addEventListener('DOMContentLoaded', function () {
          var app = new Privly.app.model.Message();
          var adapter = new Privly.app.viewAdapter.SeamlessTTLSelect(app);
          adapter.start();
        });
        Severity: Major
        Found in Message/js/controllers/seamless_ttlselect.js and 2 other locations - About 2 hrs to fix
        PlainPost/js/controllers/seamless.js on lines 8..12
        PlainPost/js/controllers/seamless_ttlselect.js on lines 12..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 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 3 locations. Consider refactoring.
        Open

        document.addEventListener('DOMContentLoaded', function () {
          var app = new Privly.app.model.Plainpost();
          var adapter = new Privly.app.viewAdapter.SeamlessTTLSelect(app);
          adapter.start();
        });
        Severity: Major
        Found in PlainPost/js/controllers/seamless_ttlselect.js and 2 other locations - About 2 hrs to fix
        Message/js/controllers/seamless_ttlselect.js on lines 12..16
        PlainPost/js/controllers/seamless.js on lines 8..12

        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 3 locations. Consider refactoring.
        Open

        document.addEventListener('DOMContentLoaded', function () {
          var app = new Privly.app.model.Plainpost();
          var adapter = new Privly.app.viewAdapter.Seamless(app);
          adapter.start();
        });
        Severity: Major
        Found in PlainPost/js/controllers/seamless.js and 2 other locations - About 2 hrs to fix
        Message/js/controllers/seamless_ttlselect.js on lines 12..16
        PlainPost/js/controllers/seamless_ttlselect.js on lines 12..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 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 get_link_creation_apps has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

        def get_link_creation_apps():
          """
          Gets a list of the apps that will be included in the top navigation
          for generating new links
          """
        Severity: Minor
        Found in build.py - 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

        Function onConnectionCheckSucceeded has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          SeamlessAdapter.prototype.onConnectionCheckSucceeded = function () {
            var self = this;
            return self
              .emitAsync('connectionCheckSucceeded')
              .then(self.getTTLOptions.bind(self))
        Severity: Minor
        Found in shared/javascripts/viewAdapters/seamless.js - About 1 hr to fix

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

            checkRegistration: function(response) {
              $("#register").prop('disabled', false); 
              if ( response.json.success === true ) {
                callbacks.pendingRegistration();
              } else {
          Severity: Major
          Found in Login/js/new.js and 1 other location - About 1 hr to fix
          Login/js/new.js on lines 102..109

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

          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

            checkCredentials: function(response) {
              $("#login").prop('disabled', false);
              if ( response.json.success === true ) {
                callbacks.pendingPost();
              } else {
          Severity: Major
          Found in Login/js/new.js and 1 other location - About 1 hr to fix
          Login/js/new.js on lines 114..121

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

          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 3 locations. Consider refactoring.
          Open

            Privly.options.setPrivlyButtonEnabled = function (enabled) {
              if (typeof enabled !== 'boolean') {
                throw new Error('invalid argument');
              }
              Privly.storage.set('options/privlyButton', enabled);
          Severity: Major
          Found in shared/javascripts/options.js and 2 other locations - About 1 hr to fix
          shared/javascripts/options.js on lines 217..224
          shared/javascripts/options.js on lines 353..360

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

          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 3 locations. Consider refactoring.
          Open

            Privly.options.setInjectionEnabled = function (enabled) {
              if (typeof enabled !== 'boolean') {
                throw new Error('invalid argument');
              }
              Privly.storage.set('options/injection', enabled);
          Severity: Major
          Found in shared/javascripts/options.js and 2 other locations - About 1 hr to fix
          shared/javascripts/options.js on lines 192..199
          shared/javascripts/options.js on lines 353..360

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

          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 3 locations. Consider refactoring.
          Open

            Privly.options.setServerUrl = function (url) {
              if (typeof url !== 'string') {
                throw new Error('invalid argument');
              }
              Privly.storage.set('options/contentServer/url', url);
          Severity: Major
          Found in shared/javascripts/options.js and 2 other locations - About 1 hr to fix
          shared/javascripts/options.js on lines 192..199
          shared/javascripts/options.js on lines 217..224

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

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

            Privly.options.upgrade = function () {
              // Privly posting button
              var disableButton = ls.getItem('Options:DissableButton');
              if (disableButton !== undefined) {
                try {
          Severity: Minor
          Found in shared/javascripts/options.js - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language