Showing 8 of 82 total issues
TimelineToolbar
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
const TimelineToolbar = React.createClass({
propTypes: {
onToolbarChange: React.PropTypes.func,
},
Function getDateFromStore
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
getDateFromStore() {
const selected = 10;
const ranges = [
{
id: 10,
Function _stringContainsFromList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_stringContainsFromList(string, filterString) {
let match = false;
if (filterString) {
const filters = filterString.split(',');
if (string) {
- 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 _runTests
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function _runTests(testGlob, reporter, sourceGlob, reportDir, coverageReporters, tdd, resolve) {
Function renderMenu
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
renderMenu(key, items, hasAdd, hasCustom) {
const menu = [];
if (items && items.length > 0) {
items.map((item) => {
menu.push(<MenuItem
- 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 _filterBuildCalenarEvents
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_filterBuildCalenarEvents(userId, events, filter) {
const results = [];
for (let index = 0; index < events.length; index++) {
if (events[index].creator && events[index].creator.email === userId) {
if (this._stringContainsFromList(events[index].summary, filter) || this._stringContainsFromList(events[index].title, filter)) {
- 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 runTests
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function runTests(sourceGlob, testGlob, reportDir, reporter = DEFAULT_SPEC_REPORTER, coverageReporters = DEFAULT_COVERAGE_REPORTERS, tdd = false) {
Function exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (value) => {
if (typeof value === 'string') {
const match = value.match(regexIso8601);
if (match) {
const milliseconds = Date.parse(match[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"