Showing 44 of 104 total issues
File deep-analyzer-page-summary.js
has 498 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
ApolloMutationController,
ApolloQueryController,
ApolloSubscriptionController,
} from '@apollo-elements/core';
Function startApolloServer
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const startApolloServer = async () => {
const validateAndAppendPermissions = jwt({
secret: jwks.expressJwtSecret({
cache: true,
rateLimit: true,
Function startApolloServer
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const startApolloServer = async () => {
const commander = new Commander(logger);
const kafka = new Kafka({
clientId: 'deep-microservice-collection',
Function startGatewayService
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const startGatewayService = async () => {
const gateway = new ApolloGateway({
serviceList: [
{
name: 'analysis',
Function styles
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static get styles() {
const INPUT_RADIUS = 3;
const INPUT_WIDTH = 90;
return css`
:host {
Function constructor
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor() {
super();
this.sentimentDatas = [];
Function constructor
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
tweetStore,
economicEntityMemo,
commander,
admin,
Function styles
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static get styles() {
return css`
:host {
display: block;
position: relative;
Function execute
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async execute() {
try {
const alreadyExists = await this._k8sClient.exists(
'cronjob',
this._options.name,
DeepAnalyzerPageSummary
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class DeepAnalyzerPageSummary extends LitElement {
/**
* Lit component property definitions.
*/
static get properties() {
Function startApolloServer
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const startApolloServer = async () => {
await attachExitHandler(async () => {
await mongoClient.close();
});
Function startApolloServer
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
const startApolloServer = async () => {
const validateAndAppendPermissions = jwt({
secret: jwks.expressJwtSecret({
cache: true,
rateLimit: true,
- 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
File collection-service.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
EconomicEntityFactory,
EconomicEntityType,
validEconomicEntities,
} from '@thinkdeep/model';
Function execute
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async execute() {
try {
this._obj = await this._k8sClient.create(`
apiVersion: "batch/v1"
kind: "Job"
Function initApolloClient
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const initApolloClient = async (user) => {
const authHeaders = (_user) => {
return {
authorization: _user?.accessToken ? `Bearer ${_user.accessToken}` : '',
me: _user?.idToken ? _user.idToken : '',
Function styles
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static get styles() {
return [
css`
:host {
display: grid;
Function listen
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async listen() {
this._logger.info(`Starting apollo server.`);
await this._apolloServer.start();
this._expressApp.disable('x-powered-by');
Function _commands
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_commands(economicEntity) {
if (!validEconomicEntities([economicEntity])) {
throw new Error(
`Economic entity was invalid. Received: ${economicEntity.toString()}`
);
Function _addSentiment
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
async _computeSentiment(economicEntity, datas) {
if (!validEconomicEntities([economicEntity])) {
throw new Error(`An invalid economic entity was received.`);
}