Function action
has 47 lines of code (exceeds 25 allowed). Consider refactoring.
@Method()
async action(action: TA, value?: any) {
switch (action) {
case TA.bold:
case TA.indent:
Function renderAngular
has 47 lines of code (exceeds 25 allowed). Consider refactoring.
export const renderAngular = (
setupOptions: NgSetupOptions | NgSetupOptions[],
request: FastifyRequest,
opts?: RenderOptions
) => {
Function getState
has 29 lines of code (exceeds 25 allowed). Consider refactoring.
private getState() {
const backState: TextActionState = {};
const fb = this.queryCommandValue('formatBlock');
if (fb === 'blockquote') {
backState[TA.quote] = true;
Function copyAssets
has 28 lines of code (exceeds 25 allowed). Consider refactoring.
export async function copyAssets(
entries: { glob: string; ignore?: string[]; input: string; output: string; flatten?: boolean }[],
basePaths: Iterable<string>,
root: string,
changed?: Set<string>
Function elementEditDataOptions
has 26 lines of code (exceeds 25 allowed). Consider refactoring.
const elementEditDataOptions = (configs: IElementConfig[], data: IElementData, options?: ElementsEditOptions) => {
const { tag, class: cls, attributes: attrs, events } = data;
if (!tag) {
return null;
Avoid deeply nested control flow statements.
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true });
}
Function action
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
@Method()
async action(action: TA, value?: any) {
switch (action) {
case TA.bold:
case TA.indent:
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
render() {
const cls = {
loaded: !!this.loaded,
[this.animation]: !!this.animation
};
Function getHtmlCoverageInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
function getHtmlCoverageInfo(html: string) {
const back: CoverageInfo = {} as any;
let newHtml = html;
for (let i = 0; i < 4; i++) {
const match = reg.exec(newHtml);