18F/State-TalentMAP

View on GitHub

Showing 15 of 15 total issues

Function login has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function* login(credentials = {}) {
const isSAML = auth.isSAMLAuth();
let token = null;
 
// if credentials is null, don't attempt login, to prevent a loop
Severity: Minor
Found in src/login/sagas.js - About 1 hr to fix

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

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

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

render() {
const { details } = this.props;
const { shouldShowDescriptionEditor, newDescriptionContent,
shouldDisplayFullDescription } = this.state;
 
 

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

render() {
const { loading } = this.state;
const {
as: type,
className,
Severity: Minor
Found in src/Components/Favorite/Favorite.jsx - About 1 hr to fix

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

function* loginWatcher() {
const evaluate = true;
// Check if user entered already logged in or not
while (evaluate) {
const isSAML = (process.env.LOGIN_MODE === 'saml');
Severity: Minor
Found in src/login/sagas.js - About 1 hr to fix

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

export const focusByFirstOfHeader = (timeout = 1) => {
setTimeout(() => {
let element = document.getElementsByTagName('h1');
if (element) { element = element[1]; }
if (!element) { element = document.getElementsByTagName('h2')[0]; }
Severity: Minor
Found in src/utilities.js - About 1 hr to fix

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

function getProps(options, roles, params = {}) {
const missingRoles = difference(options.roles, roles);
const props = {
title: options.text,
iconName: options.icon,

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

const PositionInformation = ({ assignment }) => {
const assignmentStartDate = assignment.start_date ? formatDate(assignment.start_date) : false;
const isActive = assignment.status === 'active';
let assignmentEndDate;
if (isActive) {

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

setupDefaultValues(props) {
const { skillsWasUpdated, gradeWasUpdated, qWasUpdated, bureauWasUpdated } = this.state;
const { userProfile, defaultFilters } = props;
 
// set default values for our filters
Severity: Minor
Found in src/Components/ResultsMultiSearchHeader/ResultsMultiSearchHeader.jsx - About 55 mins to fix

Function ErrorMessage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const ErrorMessage = ({ showEmptyWarning, error }) => {
const showResponseError = isObject(error) ? error.hasErrored : error; // Deprecated prop
const isError = (showEmptyWarning || showResponseError);
 
let message;

Function propSort has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const propSort = (propName, nestedPropName) => (a, b) => {
let A = a[propName];
if (nestedPropName) { A = a[propName][nestedPropName]; }
A = A.toString().toLowerCase();
let B = b[propName];
Severity: Minor
Found in src/utilities.js - About 45 mins to fix

Function ResultsCard has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const ResultsCard = (props) => {
const options = {};
const {
id,
result,
Severity: Minor
Found in src/Components/ResultsCard/ResultsCard.jsx - About 45 mins to fix

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

render() {
const { details } = this.props;
const { shouldShowWebsiteEditor, shouldShowPocEditor,
newWebsiteContent, newPocContent } = this.state;
 
 

Function difference has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const difference = (base, object) => transform(object, (result, value, key) => {
/* eslint-disable no-param-reassign */
if (!isEqual(value, base[key])) {
result[key] = isObject(value) && isObject(base[key]) ?
difference(base[key], value) :
Severity: Minor
Found in src/utilities.js - About 35 mins to fix

Merge rule .bid-count-container with rule on line 45
Open

.bid-count-container {
Severity: Minor
Found in src/sass/_results.scss by scss-lint
Severity
Category
Status
Source
Language