Showing 22 of 52 total issues
Function exports
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (suiteConfig: any) {
return function (suiteName: string, description: string, filePath: string) {
let server: IServer;
let prom: Promise<any> = simpleServer(
function (req, res) {
Function convertRemote
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const convertRemote = function (profileName: string) {
return new Promise(function (resolve) {
new Benchmark.Suite(description)
.add("GM", {
defer: true,
Function banner
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function banner(route: Route, operation: FlamingoOperation) {
let html = `
<!doctype html><html lang=""><head><link rel="icon" href="${BASE64_ICON}">
<title>${pkg.name}@${pkg.version}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
Function Convert
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export = function Convert<T extends Constructor<Route>>(Base: T) {
/**
* Basic mixin that represents the flamingo conversation process.
* @mixin
*/
Function exports
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (suiteConfig: any) {
return function (suiteName: string, description: string, filePath: string) {
let prom: Promise<any> = Promise.resolve();
function streamFunction(deferred: Deferred) {
Function preview-image
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"preview-image"(request, config: Config): Promise<ProfileInstruction> {
let { width, height } = extractDimension(
request.query,
DEFAULT_PREVIEW_IMAGE_SIZE
);
Function avatar-image
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"avatar-image"(request, config: Config): Promise<ProfileInstruction> {
let { width, height } = extractDimension(
request.query,
DEFAULT_AVATAR_SIZE
);
Function fn
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fn: function (deferred: Deferred) {
const op = new FlamingoOperation();
op.input = PARSED_HOST;
op.config = {
ACCESS: { HTTPS: { ENABLED: false } },
Function fn
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fn: function (deferred: Deferred) {
const op = new FlamingoOperation();
op.input = PARSED_HOST;
op.config = {
ACCESS: { HTTPS: { ENABLED: false } },
Function debug-preview-image
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"debug-preview-image"(request, config): Promise<ProfileInstruction> {
const dim = clamp(
envParser.objectInt("width", 200)(request.query),
10,
1024
Function debug-avatar-image
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"debug-avatar-image"(request, config): Promise<ProfileInstruction> {
const dim = clamp(
envParser.objectInt("width", 200)(request.query),
10,
1024
Function storeResults
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function storeResults(
suite: Suite & { name: string },
suiteName: string,
profileName: string
) {
Function videoProcessor
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function videoProcessor(input: stream.Readable): Promise<stream.Readable> {
return new Promise(function (resolve, reject) {
ffmpeg.ffprobe(input, function (err: Error, meta: any) {
if (err) {
reject(new InvalidInputError(err.message, err));
Function constructor
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
config: Config = {},
method: Hapi.Util.HTTP_METHODS_PARTIAL = "GET",
path = "/_debug",
description = "Debug"
Function extractDimension
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function extractDimension(
query: Record<string, any> = {},
defaultSize: number
) {
let width;
Function S3Mixin
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export = function S3Mixin<T extends Constructor<Route>>(SuperClass: T) {
/**
* Mixin that adds a video preprocessor which creates an image from a given video
* @mixin
*/
Function httpsReader
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const httpsReader: Reader = function (
operation: FlamingoOperation
): Promise<ReaderResult> {
const conf = operation.config;
const input = operation.input;
Function convertLocal
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function convertLocal(profileName: string) {
return new Promise(function (resolve) {
const gmOptions = { DEFAULT_MIME: "image/png" };
const gmRequest = { headers: {}, query: { processor: "gm" } };
const vipsOptions = { DEFAULT_MIME: "image/png" };
Function avatar-image
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
"avatar-image"(request, config: Config): Promise<ProfileInstruction> {
let { width, height } = extractDimension(
request.query,
DEFAULT_AVATAR_SIZE
);
- 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 preview-image
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
"preview-image"(request, config: Config): Promise<ProfileInstruction> {
let { width, height } = extractDimension(
request.query,
DEFAULT_PREVIEW_IMAGE_SIZE
);
- 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"