Showing 186 of 186 total issues
Function getRepoToc
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function getRepoToc(repo, fetchBranch, path) {
this.unblock();
check(repo, String);
check(fetchBranch, Match.Optional(String, null));
check(path, Match.Optional(String, null));
- 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 updateTOC
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
export function updateTOC() {
const TOC = ReDoc.Collections.TOC.find();
const repos = ReDoc.Collections.Repos.find({}).fetch();
if (TOC.count() > 0) {
- 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 APIParser
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
function APIParser(md) {
function addSections(state) {
let tokens = []; // output
const Token = state.Token;
let sectionTokens = [];
Function render
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const dropDownClassName = classnames({
"reaction-nav-dropdown-links": true,
"active": this.state.showNavDropdown
})
Function addSections
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addSections(state) {
let tokens = []; // output
const Token = state.Token;
let sectionTokens = [];
Function updateRepoData
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export function updateRepoData() {
if (hasExistingRepoData() === false) {
const repoData = getRepoData();
if (Array.isArray(repoData.repos)) {
- 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 cachePrimaryDocs
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export function cachePrimaryDocs() {
// Update repo data and TOC if they are empty;
updateRepoData();
updateTOC();
- 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 getRepoToc
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getRepoToc(repo, fetchBranch, path) {
this.unblock();
check(repo, String);
check(fetchBranch, Match.Optional(String, null));
check(path, Match.Optional(String, null));
Function _loadData
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
SearchSource.prototype._loadData = function (query, options) {
const self = this;
let version = 0;
const historyKey = query + EJSON.stringify(options);
if (this._canUseHistory(historyKey)) {
- 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 configureDefaults
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function configureDefaults() {
// default public settings
if (Meteor.settings.public.redoc === undefined) {
Meteor.settings.public.redoc = {
title: "Reaction Docs",
Function updateRepoData
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateRepoData() {
if (hasExistingRepoData() === false) {
const repoData = getRepoData();
if (Array.isArray(repoData.repos)) {
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
// Render admin dashboard
if (Meteor.userId()) {
let badges = [];
Function updateTOC
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateTOC() {
const TOC = ReDoc.Collections.TOC.find();
const repos = ReDoc.Collections.Repos.find({}).fetch();
if (TOC.count() > 0) {
Function initServiceConfiguration
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function initServiceConfiguration() {
// Import settinngs typically found in a Meteor settings file
// settings file location <app-root>/settings/settings.json
// or meteor --settings=path/to/settings.json
if (hasServices()) {
- 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 renderMenu
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderMenu(parentPath) {
let items = [];
let parentItems = _.filter(this.props.docs, function(item) { return item.parentPath === parentPath });
if (parentItems.length === 0) {
return [];
Function TOCParser
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TOCParser(md) {
md.core.ruler.after(
"inline",
"replace-link",
function (state) {
Function _loadData
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
SearchSource.prototype._loadData = function (query, options) {
const self = this;
let version = 0;
const historyKey = query + EJSON.stringify(options);
if (this._canUseHistory(historyKey)) {
Function getData
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
SearchSource.prototype.getData = function (options, getCursor) {
options = options || {};
const self = this;
this._storeDep.depend();
let selector = {$or: []};
Function renderNavigation
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderNavigation() {
const classes = classnames({
redoc: true,
sidebar: true,
visible: this.props.isMenuVisible
Function initAdminUsers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function initAdminUsers() {
if (hasServices()) {
if (Meteor.settings.redoc && Meteor.settings.redoc.users) {
for (const user of Meteor.settings.redoc.users) {
const userData = Meteor.users.findOne({
- 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"