src/Schema.ts
File Schema.ts
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Copyright (c) 2018 Rain Agency <contact@rain.agency>
* Author: Rain Agency <contact@rain.agency>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Function buildViewsMapping
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public buildViewsMapping(): void {
function pathsFinder(object: any, prefixes: string[] = []) {
let paths: string[] = [];
let value: any;
if (typeof object === "object") {
Function buildViewsMapping
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
public buildViewsMapping(): void {
function pathsFinder(object: any, prefixes: string[] = []) {
let paths: string[] = [];
let value: any;
if (typeof object === "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 mergeManifest
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public mergeManifest(environment: string): any {
const manifest = {};
const NAMESPACE = this.NAMESPACE;
this.publishing
.filter(item => _.isEmpty(item.environments) && item.key.includes(this.NAMESPACE))
Function mergeManifest
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public mergeManifest(environment: string): any {
const manifest = {};
const NAMESPACE = this.NAMESPACE;
this.publishing
.filter(item => _.isEmpty(item.environments) && item.key.includes(this.NAMESPACE))
- 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"