Showing 9 of 15 total issues
Function exports
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (React, helpers) {
const Mainmenu = React.createClass({
render: function() {
const hosts = this.props.hostData;
const events = this.props.eventData;
Function SweepFactory
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function SweepFactory (helpers) {
const CONSTANTS = helpers.CONSTANTS;
class Sweep {
constructor (options) {
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
const hosts = this.props.hostData;
const events = this.props.eventData;
const healthColor = helpers.healthColor;
let overallHealth = Math.round(
Function SweepFactory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function SweepFactory (helpers) {
const CONSTANTS = helpers.CONSTANTS;
class Sweep {
constructor (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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (React, helpers) {
const HostSearchPaneItem = React.createClass({
render: function() {
const hostData = this.props.hostData;
const healthColor = helpers.healthColor;
Function RadarFactory
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function RadarFactory (helpers) {
return class Radar {
constructor (options) {
this.log = helpers.logger(options);
Avoid deeply nested control flow statements. Open
Open
if (typeof Doplr.Sweep.types[sweepType] === 'string') {
sweepType = sweep.types[sweepType];
}
Avoid deeply nested control flow statements. Open
Open
if (Doplr.Sweep.types[sweepType] === undefined) {
type = 'host';
target = sweepType;
} else {
type = sweepType;
Function exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (options) {
options = options || {};
// Logging (should probably use winston here)
const logger = function () {
if (!options.silent) { console.log.apply(console, arguments); }
- 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"