MetaPhase-Consulting/State-TalentMAP

View on GitHub

Showing 172 of 172 total issues

Function render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const { expanded: expandedState } = this.state;
    const { id, title, children, className, controlled, expanded: expandedProp, useIdClass,
      buttonClass, childClass, preContent, disabled } = this.props;
    const formattedId = formatIdSpacing(id);
Severity: Minor
Found in src/Components/Accordion/AccordionItem/AccordionItem.jsx - About 25 mins to fix

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 CreateJobCategoryModal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const CreateJobCategoryModal = (props) => {
  const { dispatch, refSkills } = props;

  const [selectedSkillIds, setSelectedSkillIds] = useState([]);
  const [newCategoryName, setNewCategoryName] = useState('');

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 SavedSearches has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const SavedSearches = props => {
  const [selected, setSelected] = useState('all');

  const {
    savedSearches,
Severity: Minor
Found in src/Components/SavedSearches/SavedSearches.jsx - About 25 mins to fix

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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const { term, isNewTerm, hasErrored, submitGlossaryTerm } = this.props;
    const { editorHidden } = this.state;

    const { renderedTitle, renderedLink, renderedDefinition } = this.getTextToRender();
Severity: Minor
Found in src/Components/GlossaryEditor/GlossaryEditorCard/GlossaryEditorCard.jsx - About 25 mins to fix

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 Definition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const Definition = (props) => {
  const options = omit(props, keys(defaults));
  let { term, definition } = props;
  const { excludeColon } = props;

Severity: Minor
Found in src/Components/DefinitionList/Definition/Definition.jsx - About 25 mins to fix

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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    // is the bid currently saved?
    // save value and avoid interrogating the array more than once
    const { isSaved, canDelete } = this.getBidData();
    const { isClient } = this.context;
Severity: Minor
Found in src/Components/BidListButton/BidListButton.jsx - About 25 mins to fix

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 BidCount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const BidCount = ({ bidStatistics, hideLabel, label, altStyle, isCondensed, isTandemTwo }) => {
  let labelClass = 'bid-count-label';
  if (hideLabel) { labelClass = `${labelClass} usa-sr-only`; }
  const bidStatistics$ = bidStatistics || {};
  return (
Severity: Minor
Found in src/Components/BidCount/BidCount.jsx - About 25 mins to fix

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 AIMLegsFormEdit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const AIMLegsFormEdit = props => {
  const {
    efPos,
    legs,
    onClose,
Severity: Minor
Found in src/Components/Agenda/AIMLegsFormEdit/AIMLegsFormEdit.jsx - About 25 mins to fix

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 ToggleButton has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const ToggleButton = props => {
  const { labelTextLeft, labelTextRight, labelSameLine, checked,
    onChange, height, width, onColor, offColor, checkedIcon, uncheckedIcon,
    onHandleColor, offHandleColor, boxShadow, activeBoxShadow } = props;

Severity: Minor
Found in src/Components/ToggleButton/ToggleButton.jsx - About 25 mins to fix

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 getAvatarColor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const getAvatarColor = (str: string, hashAdjuster: number = 0): { backgroundColor: string, color: 'black' | 'white' } | null => {
  if (str) {
    let hash: number = Math.floor(Math.random() * hashAdjuster);

    //replaced this loop with the for loop below
Severity: Minor
Found in src/utilities.tsx - About 25 mins to fix

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 filterAPFilters has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const filterAPFilters = (data) => {
  const filters$ = data.filters.map((m) => {
    const hasAPEndpoint = has(m, 'item.endpointAP');
    const hasAltData = has(m, 'item.dataAP');
    const hasAPRef = has(m, 'item.selectionRefAP');
Severity: Minor
Found in src/reducers/filters/filters.js - About 25 mins to fix

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 mapDuplicates has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const mapDuplicates = (
  data: any[] = [],
  propToCheck: string = 'custom_description',
  transformFunc?: (item: any) => any
): any[] => {
Severity: Minor
Found in src/utilities.tsx - About 25 mins to fix

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

Severity
Category
Status
Source
Language