Showing 59 of 218 total issues
Function render
has 500 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(isNormalMode) {
let tp = lithtml.html(`
<nav>
<ul class="list">
<li class="title">
File menu-wc.js
has 512 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
customElements.define('compodoc-menu', class extends HTMLElement {
constructor() {
File createRequestHandler.test.ts
has 499 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import {
CustomSkillFactory
} from 'ask-sdk-core'
import {
File model.ts
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable import/export */
export namespace Types {
export type Locale = 'de-DE' | 'en-AU' | 'en-CA' | 'en-GB' | 'en-IN' | 'en-US' | 'es-ES' | 'es-MX' | 'fr-CA' | 'fr-FR' | 'it-IT' | 'ja-JP'
export type dateTime = string
Function displayResults
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function displayResults(res) {
var noResults = res.count == 0;
var groups = {};
$searchResults.toggleClass('no-results', noResults);
Function init
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static init (): PayloadBuilder {
const eventName = 'AMAZON.SportsEvent.Updated'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const eventLeague: Types.Soccer = {
name: 'localizedattribute:eventLeagueName'
Function init
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static init (): PayloadBuilder {
const eventName = 'AMAZON.Occasion.Updated'
const confirmationState: Types.ConfirmationState = {
confirmationStatus: 'CONFIRMED'
}
Function init
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static init (): PayloadBuilder {
const eventName = 'AMAZON.SocialGameInvite.Available'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const invite: any = {
inviter: {
Function init
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static init (): PayloadBuilder {
const eventName = 'AMAZON.MediaContent.Available'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const availability: any = {}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Function init
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static init (): PayloadBuilder {
const eventName = 'AMAZON.MessageAlert.Activated'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const state: any = {}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Function createSkill
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const createSkill = <T extends SkillConstants = SkillConstants>(config: SkillConfig<T>, handlers: SkillHandlers): CustomSkillBuilder => {
const skill = SkillBuilders.custom().withApiClient(new DefaultApiClient())
if (isS3Skill(config)) {
skill.withPersistenceAdapter(
new S3PersistenceAdapter({
Function init
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static init (): PayloadBuilder {
const eventName = 'AMAZON.OrderStatus.Updated'
const order: Types.Order = {
seller: {
Function bindSearch
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bindSearch() {
// Bind DOM
$searchInputs = $('#book-search-input input');
$searchResults = $('.search-results');
Function getListProducts
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private getListProducts (): ResponseContent {
const products = this.getProductLists()
if (products.length === 1) {
const productText = `<p>${products[0].name}. ${products[0].summary}</p>`
if (this.isJP()) {
Function getLangNameByCode
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
export const getLangNameByCode = (code: PollyLanguage, lang: PollyLanguage = 'ja-JP'): string => {
if (lang === 'ja-JP') {
if (/^en/.test(code)) return '英語'
if (/^es/.test(code)) return 'スペイン語'
if (/^it/.test(code)) return 'イタリア語'
- 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 init
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static init (): ErrorHandlerBuilder {
let handlerFilter: ErrorHandle = (handlerInput) => {
return handlerInput.responseBuilder
.speak('Sorry I could not understand the meaning. Please tell me again')
.reprompt('Could you tell me onece more?')
Function NoProductResponse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const NoProductResponse = (responseBuilder: ResponseBuilder, locale: string, products?: InskillProducts): Response => {
const purchaseableProducts = products ? getAllPurchasableProducts(products) : []
const purchaseableProductText = purchaseableProducts.map(product => product.name).join(', ')
// no purchaseable products
if (!purchaseableProductText) {
Function init
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static init (): PayloadBuilder {
const eventName = 'AMAZON.TrashCollectionAlert.Activated'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let alert: any = {}
return {
Function handle
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async handle (handlerInput: HandlerInput): Promise<Response> {
const { requestEnvelope, responseBuilder, serviceClientFactory } = handlerInput
const locale = getLocale(requestEnvelope)
if (!serviceClientFactory) {
const noISPResponse = UnSupportedISPResponse(locale)
Function init
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public static init (): TranslationBuilder {
const translationObject: TranslationObject | null = null
const languageStrings: {
[lang: string]: TranslationObject;
} = {}
- 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"