bem-site/gorshochek

View on GitHub

Showing 19 of 43 total issues

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

module.exports = (model, options) => {
    options = options || {};

    const GITHUB_URL_REGEXP = /^https?:\/\/(.+?)\/(.+?)\/(.+?)\/(tree|blob)\/(.+?)\/(.+)/;
    const githubOptions = {token: options.token};
Severity: Major
Found in src/tasks/docs/load-from-github.js - About 4 hrs to fix

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

    module.exports = (model, options) => {
        options = options || {};
        options.baseUrl = options.baseUrl || '/tags/';
        options.baseTitle = options.baseTitle || 'Tags';
    
    
    Severity: Major
    Found in src/tasks/meta/tags.js - About 3 hrs to fix

      Function exports has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = (model, params) => {
          /**
           * Returns true if page satisfies criteria. Otherwise returns fals
           * @param {Object} page - model page object
           * @returns {Boolean}
      Severity: Minor
      Found in src/tasks/override/override-doc-links.js - About 3 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 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function(model, options) {
          const DEFAULT_BUNDLE = 'index';
      
          options = options || {};
      
      
      Severity: Major
      Found in src/tasks/template/full-bem.js - About 3 hrs to fix

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

        module.exports = (model, params) => {
            /**
             * Returns true if page satisfies criteria. Otherwise returns fals
             * @param {Object} page - model page object
             * @returns {Boolean}
        Severity: Major
        Found in src/tasks/override/override-doc-links.js - About 2 hrs to fix

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

          module.exports = function(model, options) {
              options = options || {};
              options.concurrency = options.concurrency || 20;
          
              options.timeout = options.timeout || 10000;
          Severity: Major
          Found in src/tasks/docs/load-from-http.js - About 2 hrs to fix

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

            module.exports = (model, options) => {
                options = options || {};
            
                options.concurrency = options.concurrency || 20;
                options.imageFolder = options.imageFolder || '/static';
            Severity: Major
            Found in src/tasks/override/process-doc-images.js - About 2 hrs to fix

              Function exports has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = function(model, options) {
                  const DEFAULT_BUNDLE = 'index';
              
                  options = options || {};
              
              
              Severity: Minor
              Found in src/tasks/template/full-bem.js - 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 exports has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = (model) => {
                  /**
                   * Returns true if page[language] exists and have source
                   * which can be matched as relative file path on filesystem. Otherwise returns false
                   * @param {Object} page - page object
              Severity: Minor
              Found in src/tasks/docs/load-from-file.js - About 1 hr to fix

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

                module.exports = (model, options) => {
                    options = options || {};
                    options.concurrency = options.concurrency || 20;
                
                    /**
                Severity: Minor
                Found in src/tasks/docs/transform-md-html.js - About 1 hr to fix

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

                      merge(previousModel, currentModel) {
                          const modifiedPages = [];
                          const nonModifiedPages = [];
                  
                          /*
                  Severity: Minor
                  Found in src/model.js - About 1 hr to fix

                    Function exports has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = (model, options) => {
                        options = options || {};
                    
                        const GITHUB_URL_REGEXP = /^https?:\/\/(.+?)\/(.+?)\/(.+?)\/(tree|blob)\/(.+?)\/(.+)/;
                        const githubOptions = {token: options.token};
                    Severity: Minor
                    Found in src/tasks/docs/load-from-github.js - 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 processPage has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function processPage(model, page) {
                            debug(`load local file page with url: => ${page.url}`);
                    
                            const filePath = page.source; // относительный путь к файлу
                            const fileName = path.basename(filePath); // имя файла (с расширением)
                    Severity: Minor
                    Found in src/tasks/docs/load-from-file.js - About 1 hr to fix

                      Function processPage has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function processPage(model, page) {
                              debug(`load source viw http(s) for page with url: => ${page.url}`);
                      
                              const filePath = page.source; // относительный путь к файлу
                              const fileName = path.basename(filePath); // имя файла (с расширением)
                      Severity: Minor
                      Found in src/tasks/docs/load-from-http.js - About 1 hr to fix

                        Function exports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        module.exports = (model, options) => {
                            options = options || {};
                        
                            options.concurrency = options.concurrency || 20;
                            options.imageFolder = options.imageFolder || '/static';
                        Severity: Minor
                        Found in src/tasks/override/process-doc-images.js - 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 exports has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = (model, options) => {
                            options = options || {};
                        
                            // option host is required parameter
                            if(!options.host) {
                        Severity: Minor
                        Found in src/tasks/sitemap/sitemap-xml.js - About 1 hr to fix

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

                              function findLinkHrefReplacement(linkHref, page, sourceUrlsMap, existedUrls) {
                                  const _linkHref = linkHref;
                          
                                  // If URL starts with `https://${lang}.bem.info` replace it with `root`
                                  if(params && params.host && linkHref.indexOf(params.host) === 0) {
                          Severity: Minor
                          Found in src/tasks/override/override-doc-links.js - About 1 hr to fix

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

                                executeAPIMethod(method, options, headers, callback) {
                                    // максимальное число допустимых повторных обращений к github в случае возникновения ошибки
                                    const ATTEMPTS = 5;
                            
                                    debug(`github API call for ${method} with options:`);
                            Severity: Minor
                            Found in src/tasks/docs/github/index.js - About 1 hr to fix

                              Function processPage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function processPage(model, page) {
                                      debug(`Load doc file for page with url: => ${page.url}`);
                                      const repoInfo = parseSourceUrl(page.source);
                                      return readMetaFromCache(page)
                                          .then(cache => Q.all([
                              Severity: Minor
                              Found in src/tasks/docs/load-from-github.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language