github-tools/github-extended

View on GitHub

Showing 11 of 158 total issues

File search_index.js has 464 lines of code (exceeds 250 allowed). Consider refactoring.
Open

window.esdocSearchIndex = [
  [
    "github-extended~github",
    "class/src/github-extended.js~Github.html",
    "<span>Github</span> <span class=\"search-result-import-path\">github-extended</span>",
Severity: Minor
Found in doc/script/search_index.js - About 7 hrs to fix

    Function constructor has 160 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

       constructor(options) {
          super(options);
    
          let superGetRepo = this.getRepo;
          let request = this.request || this._request; // jscs:ignore disallowDanglingUnderscores
    Severity: Major
    Found in src/github-extended.js - About 6 hrs to fix

      Function getRepo has 155 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            this.getRepo = (user, repo) => {
               let repository = superGetRepo(user, repo);
               let superRemove = repository.remove;
               let superFork = repository.fork;
      
      
      Severity: Major
      Found in src/github-extended.js - About 6 hrs to fix

        Function constructor has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

           constructor(options) {
              super(options);
        
              let superGetRepo = this.getRepo;
              let request = this.request || this._request; // jscs:ignore disallowDanglingUnderscores
        Severity: Minor
        Found in src/github-extended.js - About 5 hrs 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 exports has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(config) {
           config.set({
              browserify: {
                 debug: true,
                 transform: [
        Severity: Major
        Found in karma.conf.js - About 2 hrs to fix

          Function remove has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                   repository.remove = (branchName = 'master', path = '') => {
                      function removeFile(branchName, path) {
                         return new Promise((resolve, reject) => {
                            superRemove(branchName, path, error => {
                               if (error) {
          Severity: Major
          Found in src/github-extended.js - About 2 hrs to fix

            Function search has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                     repository.search = (string, options = {}) => {
                        const FILE = 'blob';
                        const FOLDER = 'tree';
            
                        options = Object.assign({
            Severity: Minor
            Found in src/github-extended.js - About 1 hr to fix

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

                function toggle(ev) {
                  var button = ev.target;
                  var parent = ev.target.parentElement;
                  while(parent) {
                    if (parent.tagName === 'TR' && parent.classList.contains('test-describe')) break;
              Severity: Minor
              Found in doc/script/test-summary.js - About 1 hr to fix

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

                            function removeFolder() {
                               return new Promise((resolve, reject) => {
                                  repository.getRef(`heads/${branchName}`, (error, sha) => {
                                     if (error) {
                                        reject(error);
                Severity: Minor
                Found in src/github-extended.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                          if (link) location.href = link.href;
                  Severity: Major
                  Found in doc/script/search.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                              if (innerButton && innerButton.classList.contains('opened')) {
                                innerButton.classList.remove('opened');
                                innerButton.classList.add('closed');
                              }
                    Severity: Major
                    Found in doc/script/test-summary.js - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language