Showing 6 of 21 total issues
Function CatalogDataView
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CatalogDataView = (props) => {
const { dispatch, catalogData, loading, filterText, errorfetching } = props;
let open = false;
let initHeight = 120;
let intval = null;
Function EditForm
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
let EditForm = (props) => {
const { onSubmitEdit, submitSucceeded, error, handleSubmit, pristine, reset, submitting, initialValues }=props;
return(
<div>
Function slideToggle
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const slideToggle = (element) => {
window.clearInterval(intval);
let mdiv = document.getElementById('mdiv');
mdiv = element;
if(getComputedStyle(mdiv).getPropertyValue('display') === "none"){
Function CatalogDataView
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
const CatalogDataView = (props) => {
const { dispatch, catalogData, loading, filterText, errorfetching } = props;
let open = false;
let initHeight = 120;
let intval = 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 AddForm
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AddForm = (props) => {
const { onSubmitAdd, submitSucceeded, error, handleSubmit, pristine, reset, submitting }=props;
return(
<div>
<PageHeader>Add a New MicroService</PageHeader>
Function DetailView
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
const DetailView = (serviceDetails) => {
let detailHtml = [];
let data = serviceDetails;
let keys = Object.keys(data);
for(let i=0; i<keys.length; i++){
- 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"