Showing 104 of 104 total issues
Function _commands
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_commands(economicEntity) {
if (!validEconomicEntities([economicEntity])) {
throw new Error(
`Economic entity was invalid. Received: ${economicEntity.toString()}`
);
Similar blocks of code found in 2 locations. Consider refactoring. Open
try {
this._logger.debug(`Creating topics ${JSON.stringify(topics)}`);
await this._admin.createTopics({
/**
* NOTE: If you don't wait for leaders the system throws an error when trying to write to the topic if a leader
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 69.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
try {
await this._admin.createTopics({
/**
* NOTE: If you don't wait for leaders the system throws an error when trying to write to the topic if a leader
* hasn't been selected.
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 69.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function _addSentiment
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _addSentiment(economicEntity, utcDateTime, data) {
if (!validEconomicEntities([economicEntity])) {
throw new Error(
`Invalid economic entity received:\n${JSON.stringify(economicEntity)}`
);
Function _computeSentiment
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _computeSentiment(economicEntity, datas) {
if (!validEconomicEntities([economicEntity])) {
throw new Error(`An invalid economic entity was received.`);
}
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: []};
Similar blocks of code found in 2 locations. Consider refactoring. Open
try {
const alreadyExists = await this._k8sClient.exists(
'cronjob',
this._options.name,
this._options.namespace
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 63.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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"
Similar blocks of code found in 2 locations. Consider refactoring. Open
try {
this._logger.info(`Deleting cron job.\n\n${stringify(this._obj)}`);
await this._k8sClient.delete(this._obj);
} catch (e) {
this._logger.error(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 63.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
static graphQLTypeDefinition() {
return `
enum ${this.graphQLType()} {
${this.types.map(
(type) => `
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 60.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
static graphQLTypeDefinition() {
return `
enum ${this.graphQLType()} {
${this.types.map(
(type) => `
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 60.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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">