MetaPhase-Consulting/State-TalentMAP

View on GitHub

Showing 172 of 172 total issues

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

  render() {
    const { showMore } = this.state;
    const { result, isProjectedVacancy, fromPostMenu } = this.props;

    const pos = result.position || result;
Severity: Minor
Found in src/Components/BureauPage/BureauResultsCard/BureauResultsCard.jsx - About 1 hr 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 BidTrackerCardTitle has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const BidTrackerCardTitle = ({
  title,
  positionNumber,
  id,
  bidStatistics,

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

export const NotificationRow = ({ id, message, tags, deleteOne, date, isRead, onCheck, checked,
  meta, onNavigateTo }) => {
  let link;
  let buttonTitle;
  let buttonTitle2;
Severity: Minor
Found in src/Components/Notifications/NotificationRow/NotificationRow.jsx - About 1 hr 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 EditBidSeasons has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const EditBidSeasons = ({
  id,
  description,
  bidSeasonsBeginDate,
  bidSeasonsEndDate,

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

const AIMLegsFormRead = props => {
  const { legs } = props;

  const showOverlay = !legs.length;
  const [rowHoverNum, setRowHoverNum] = useState();
Severity: Minor
Found in src/Components/Agenda/AIMLegsFormRead/AIMLegsFormRead.jsx - About 1 hr 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 exports has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function (config) {
  function isAllowed(headerValue, allowedValues) {
    if (!headerValue || !allowedValues) { return false; }
    return allowedValues.some((candidate) => {
      if (typeof candidate === 'string') {
Severity: Minor
Found in src/host-validation.js - About 1 hr 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

Consider simplifying this complex logical expression.
Open

    if (recId === id && useRecommended && !NPrecIsLoading &&
      !NPrecHasErrored && NPsuggestions && clientHasLoaded && clicked) {
      this.stringifyParamsAndNavigate(NPsuggestions, history);
    }

    Function localStorageToggleValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    export function localStorageToggleValue(key, value, useDispatch = true, onlyDelete = false) {
      const existingArray = JSON.parse(localStorage.getItem(key)) || [];
      // check if the value matches, either as a string or as a number
      let indexOfId = existingArray.indexOf(value);
      if (indexOfId <= -1) {
    Severity: Minor
    Found in src/utilities.js - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
    Open

      render() {
        const hidden = {
          display: 'none',
        };
        const { id, type, submitText, placeholder, inputDisabled,
    Severity: Minor
    Found in src/Components/SearchBar/SearchBar.jsx - About 55 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 Paragraphs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    const Paragraphs = (props) => {
      const { paragraphs, getCableValue, modCableValue } = props;
    
      // Instead of making a ton of variables for tracking the various input data for all
      // paragraphs, I made a data object array that tracks all the important information

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

    const AssignmentNotification = (props) => {
      const location = props.location?.pathname;
      const params = location.split('/');
      const viewType = params[2];
      const noteType = params[5];

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

    const ResultsPillContainer = ({ items, onPillClick, isClientsPage }) => {
      const [showFilters, setShowFilters] = useState(false);
    
      return (
        isClientsPage ?
    Severity: Minor
    Found in src/Components/ResultsPillContainer/ResultsPillContainer.jsx - About 55 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 BidSteps has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    const BidSteps = (props, context) => {
      const { bid, collapseOverlay } = props;
      const { condensedView } = context;
      const bidData = bidClassesFromCurrentStatus(bid).stages || {};
      const handshakeRegisterWithAnotherBidder = get(bid, 'position_info.bid_statistics[0].has_handshake_offered')
    Severity: Minor
    Found in src/Components/BidTracker/BidStep/BidSteps.jsx - About 55 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 getResult has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    export const getResult = (result, path, defaultValue, isRate = false) => {
      let value = get(result, path, defaultValue);
    
      if ((/_date|date_|ted/i).test(path) && value !== defaultValue) {
        value = formatDate(value);
    Severity: Minor
    Found in src/utilities.js - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
    Open

      render() {
        const { status, statusIsLoading, statusUpdateIsLoading, statusUpdateHasErrored,
          statusHasErrored, id, biddersInShortList } = this.props;
        const isLoading = statusIsLoading || statusUpdateIsLoading;
        let text = 'Lock';
    Severity: Minor
    Found in src/Components/BureauPage/ShortListLock/ShortListLock.jsx - About 55 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 PositionDetailsItem has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    const PositionDetailsItem = (props) => {
      const {
        details,
        editDescriptionContent,
        resetDescriptionEditMessages,
    Severity: Minor
    Found in src/Components/PositionDetailsItem/PositionDetailsItem.jsx - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
    Open

      render() {
        const { position,
          favorites,
          favoritesTandem,
          favoritesPV,
    Severity: Minor
    Found in src/Components/ResultsCondensedCardBottom/ResultsCondensedCardBottom.jsx - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
    Open

      render() {
        const { positionCount, isLoading } = this.props;
        // Round to nearest ten, but only if there are more than 50 positions.
        // Subtract the count by 6 to ensure that it will always be rounded down to the nearest 10 (-1)
        const shouldRound = positionCount > 50;
    Severity: Minor
    Found in src/Components/HomePageBanner/HomePageBanner.jsx - About 55 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 localStorageToggleValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    export function localStorageToggleValue(key: string, value: any, useDispatch: boolean = true, onlyDelete: boolean = false): void {
      const existingArray = JSON.parse(localStorage.getItem(key) ?? '') || [];
      // check if the value matches, either as a string or as a number
      let indexOfId = existingArray.indexOf(value);
      if (indexOfId <= -1) {
    Severity: Minor
    Found in src/utilities.tsx - About 55 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 getCustomLocation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export function getCustomLocation(loc, org) {
      if (!loc) return NO_POST;
      // DC Post - org ex. GTM/EX/SDD
      if (get(loc, 'state') === 'DC') return org || NO_POST;
      // Domestic outside of DC - City, State
    Severity: Minor
    Found in src/utilities.js - About 45 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