adobe/brackets

View on GitHub
src/JSUtils/Session.js

Summary

Maintainability
D
2 days
Test Coverage

File Session.js has 432 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (c) 2013 - present Adobe Systems Incorporated. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
Severity: Minor
Found in src/JSUtils/Session.js - About 6 hrs to fix

    Function getHints has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Session.prototype.getHints = function (query, matcher) {
    
            if (query === undefined) {
                query = "";
            }
    Severity: Major
    Found in src/JSUtils/Session.js - About 2 hrs to fix

      Function getParameterHint has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Session.prototype.getParameterHint = function () {
              var fnHint = this.fnType,
                  cursor = this.getCursor(),
                  token = this.getToken(this.functionCallPos),
                  start = {line: this.functionCallPos.line, ch: token.start},
      Severity: Major
      Found in src/JSUtils/Session.js - About 2 hrs to fix

        Function getFunctionInfo has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Session.prototype.getFunctionInfo = function () {
                var inFunctionCall   = false,
                    cursor           = this.getCursor(),
                    functionCallPos,
                    token            = this.getToken(cursor),
        Severity: Major
        Found in src/JSUtils/Session.js - About 2 hrs to fix

          Function filterWithQueryAndMatcher has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function filterWithQueryAndMatcher(hints, matcher) {
                      var matchResults = $.map(hints, function (hint) {
                          var searchResult = matcher.match(hint.value, query);
                          if (searchResult) {
                              searchResult.value = hint.value;
          Severity: Minor
          Found in src/JSUtils/Session.js - About 1 hr to fix

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

                        var matchResults = $.map(hints, function (hint) {
                            var searchResult = matcher.match(hint.value, query);
                            if (searchResult) {
                                searchResult.value = hint.value;
                                searchResult.guess = hint.guess;
            Severity: Minor
            Found in src/JSUtils/Session.js - About 1 hr to fix

              Avoid deeply nested control flow statements.
              Open

                                  } else if (i + 1 === n) {
                                      // look for a comma after the node.end. This will tell us we
                                      // are on the next argument, even there is no text, and therefore no node,
                                      // for the next argument.
                                      text = fragment.substring(node.end, offset);
              Severity: Major
              Found in src/JSUtils/Session.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (text.indexOf(",") >= (offset - lastEnd)) {
                                            // comma is after the offset so the current arg is the
                                            // previous arg node.
                                            i--;
                                        } else if (i === 0 && text.indexOf("(") !== -1) {
                Severity: Major
                Found in src/JSUtils/Session.js - About 45 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return 0;
                  Severity: Major
                  Found in src/JSUtils/Session.js - About 30 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status