Showing 44 of 104 total issues
Function _handleTweetsFetched
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _handleTweetsFetched(utcDateTime, economicEntity, tweets) {
if (!validDate(utcDateTime)) {
throw new Error(`${utcDateTime} is an invalid date.`);
}
Function validateAndFetchPermissionsAndMe
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const validateAndFetchPermissionsAndMe = async (connectionParams, extra) => {
if (!extra?.request) {
throw new Error('The request object was not valid.');
}
Function constructor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
super();
this.configuration = {observedEconomicEntities: []};
Function _selectionInputs
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_selectionInputs(siteConfiguration) {
return html`
<div class="input selection">
<mwc-select
id="business"
Function connect
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async connect() {
this._logger.info(`Connecting to analysis service support systems.`);
await attachExitHandler(async () => {
this._logger.info('Cleaning up kafka connections.');
Function readMostRecentSentiment
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
async readMostRecentSentiment(economicEntity) {
if (!validEconomicEntities([economicEntity])) {
throw new Error(
`Invalid economic entity received:\n${JSON.stringify(economicEntity)}`
);
Function _validSentimentDatas
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
_validSentimentDatas(datas) {
if (!Array.isArray(datas) || datas.length <= 0) {
return false;
}
- 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 _webSites
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
async _webSites(
subject,
searchEngine = DDG,
reqLib = axios,
robotsTxtParser = robotsParser
- 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 startGatewayService
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const startGatewayService = async () => {
const gateway = new ApolloGateway({
serviceList: [
{
name: 'analysis',
- 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 _webSites
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _webSites(
subject,
searchEngine = DDG,
reqLib = axios,
robotsTxtParser = robotsParser
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return html`
<div class="grid">
<h1 class="slogan">${translate('translations:headline')}</h1>
<div class="features">
Function readSentiments
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
async readSentiments(economicEntity, startDate, endDate) {
if (!validEconomicEntities([economicEntity])) {
throw new Error(
`Invalid economic entity received:\n${JSON.stringify(economicEntity)}`
);
Function initAuth
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const initAuth = async (options) => {
if (!options?.domain || !options.clientId || !options.audience) {
throw new Error('The domain, clientId and audience are required.');
}
Function emitEvent
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async emitEvent(eventName, data) {
this._logger.debug(
`Creating event ${eventName} in kafka if it does not already exist.`
);
try {
Function styles
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
static get styles() {
return [
css`
:host {
transition: box-shadow 0.3s;
Function properties
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
static get properties() {
return {
user: {type: Object},
configuration: {
type: Object,
- 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 _sentimentSummaryCard
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_sentimentSummaryCard(sentimentDatas) {
return sentimentDatas.length > 0
? html`
<deep-card class="card">
<h4 slot="header">Sentiment Summary</h4>
Function startApolloServer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const startApolloServer = async () => {
const commander = new Commander(logger);
const kafka = new Kafka({
clientId: 'deep-microservice-collection',
- 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 constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
constructor() {
super();
this.sentimentDatas = [];
- 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 startApolloServer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const startApolloServer = async () => {
await attachExitHandler(async () => {
await mongoClient.close();
});
- 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"