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};
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';
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}
- Read upRead up
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 || {};
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}
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;
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';
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 || {};
- Read upRead up
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
Function exports
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (model, options) => {
options = options || {};
options.concurrency = options.concurrency || 20;
/**
Function merge
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
merge(previousModel, currentModel) {
const modifiedPages = [];
const nonModifiedPages = [];
/*
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};
- Read upRead up
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); // имя файла (с расширением)
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); // имя файла (с расширением)
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';
- Read upRead up
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) {
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) {
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:`);
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([