jakearchibald/tweetdeck-prototype

View on GitHub

Showing 58 of 58 total issues

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

TD.transformLoginResponse = function (res) {
  if (res.screen_name) {
    return new User({
      screenName: res.screen_name,
      id: res.user_id,
Severity: Minor
Found in www/static/js/lib/tweetdeck/index.js - About 1 hr to fix

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

    exports.processEntities = function processEntities(text, entitiesMap) {
      var entities = [];
    
      for (var type in entitiesMap) {
        entitiesMap[type].forEach(function(entity) {
    Severity: Minor
    Found in www/static/js/lib/tweetdeck/utils.js - About 1 hr to fix

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

      module.exports.createApp = function (opts) {
        var app = express();
      
        app.engine('html', swig.renderFile);
        app.set('view cache', false);
      Severity: Minor
      Found in server/index.js - About 1 hr to fix

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

        function buildTask(watch) {
          // sass
          if (watch) {
            gulp.watch('www/static/css/**/*.scss', ['sass']);
          }
        Severity: Minor
        Found in gulpfile.js - About 1 hr to fix

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

            render() {
              if (!this.state.attemptedLogin) {
                return (
                  <div className="app"></div>
                );
          Severity: Minor
          Found in www/static/js/component/root.js - About 1 hr to fix

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

            module.exports = http.createServer(function (request, response) {
              var data = {
                method: request.method,
                host: TD.host,
                port: TD.port,
            Severity: Minor
            Found in server/tweetdeck-proxy.js - About 1 hr to fix

              Function up has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  up(requestResult) {
                    if (!requestResult.result.length) {
                      return requestResult.request.cursor;
                    }
                    var topTweets = requestResult.result.slice(0, 2);
              Severity: Minor
              Found in www/static/js/lib/tweetdeck/column-utils.js - About 1 hr to fix

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

                    constructor() {
                        this.store = new IndexedDouchebag('key-value-store', 1, function(db, oldVersion) {
                            if (oldVersion < 1 || oldVersion === 9223372036854776000) {
                                db.createObjectStore('key-value-store');
                            }
                Severity: Major
                Found in www/static/js/lib/idb-key-value-store.js and 1 other location - About 1 hr to fix
                www/static/js/lib/tweetdeckdb.js on lines 6..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 57.

                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

                  if (IndexedDouchebag.supported) {
                    this.idb = new IndexedDouchebag('tweetdeck', 1, function(db, oldVersion) {
                      if (oldVersion < 1 || oldVersion === 9223372036854776000) {
                        db.createObjectStore('keyval');
                      }
                Severity: Major
                Found in www/static/js/lib/tweetdeckdb.js and 1 other location - About 1 hr to fix
                www/static/js/lib/idb-key-value-store.js on lines 4..10

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

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

                  var initialPrefetch = new Promise(function(resolve, reject) {
                    var openRequest = indexedDB.open("tweetdeck", 1);
                    openRequest.onsuccess = function(event) {
                      var query = openRequest.result.transaction('keyval').objectStore('keyval').get('session');
                      query.onsuccess = function(event) {
                Severity: Minor
                Found in www/static/js/head.js - About 1 hr to fix

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

                    getHTML() {
                      if (this._html === undefined) {
                        this._html = tweetdeckUtils.processEntities(this._text, this._entities);
                      }
                      return this._html;
                  Severity: Minor
                  Found in www/static/js/lib/tweetdeck/tweetcolumnitem.js and 1 other location - About 55 mins to fix
                  www/static/js/lib/tweetdeck/twitteruser.js on lines 17..22

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

                  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

                  TwitterUserProto.getDescriptionHTML = function() {
                    if (this._descriptionHTML === undefined) {
                      this._descriptionHTML = tweetdeckUtils.processEntities(this._description, this._descriptionEntities);
                    }
                    return this._descriptionHTML;
                  Severity: Minor
                  Found in www/static/js/lib/tweetdeck/twitteruser.js and 1 other location - About 55 mins to fix
                  www/static/js/lib/tweetdeck/tweetcolumnitem.js on lines 33..38

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 54.

                  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

                    if (IndexedDouchebag.supported) {
                      p = this.idb.get('keyval', 'account');
                    }
                    else {
                      p = Promise.resolve(localStorage['tweetdeck:account']);
                  Severity: Minor
                  Found in www/static/js/lib/tweetdeckdb.js and 1 other location - About 55 mins to fix
                  www/static/js/lib/tweetdeckdb.js on lines 20..25

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

                  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

                    if (IndexedDouchebag.supported) {
                      p = this.idb.get('keyval', 'user');
                    }
                    else {
                      p = Promise.resolve(localStorage['tweetdeck:user']);
                  Severity: Minor
                  Found in www/static/js/lib/tweetdeckdb.js and 1 other location - About 55 mins to fix
                  www/static/js/lib/tweetdeckdb.js on lines 48..53

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

                  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 transaction has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  IndexedDouchebagProto.transaction = function(stores, modeOrCallback, callback) {
                    return this.ready.then(function(db) {
                      var mode = 'readonly';
                  
                      if (modeOrCallback.apply) {
                  Severity: Minor
                  Found in www/static/js/lib/indexeddouchebag.js - About 55 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                    onRetweet() {
                      if (!this.props.item.retweeted) {
                        this.props.onRetweet(this.props.item);
                      }
                    },
                  Severity: Minor
                  Found in www/static/js/component/column-item.js and 1 other location - About 50 mins to fix
                  www/static/js/component/column-item.js on lines 34..38

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 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

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

                    onFavorite() {
                      if (!this.props.item.favorited) {
                        this.props.onFavorite(this.props.item);
                      }
                    },
                  Severity: Minor
                  Found in www/static/js/component/column-item.js and 1 other location - About 50 mins to fix
                  www/static/js/component/column-item.js on lines 40..44

                  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

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

                  class RequestResult {
                      constructor(request, result, data) {
                          this.request = request;
                          this.result = result;
                          this.data = data;
                  Severity: Minor
                  Found in www/static/js/lib/request-result.js and 1 other location - About 45 mins to fix
                  www/static/js/lib/request-result.js on lines 1..7

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

                  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

                  class Request {
                      constructor(account, cursor, data) {
                          this.account = account;
                          this.cursor = cursor;
                          this.data = data;
                  Severity: Minor
                  Found in www/static/js/lib/request-result.js and 1 other location - About 45 mins to fix
                  www/static/js/lib/request-result.js on lines 9..15

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 50.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          return this.fromComparator(this.from, other.from) === 0 &&
                                 this.toComparator(this.to, other.to) === 0;
                  Severity: Minor
                  Found in www/static/js/lib/interval.js and 1 other location - About 40 mins to fix
                  www/static/js/lib/interval.js on lines 250..251

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

                  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