Showing 12 of 133 total issues
File gulpfile.js
has 581 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
const cocoonSDK = require("cocoon-cloud-sdk");
const fs = require("fs");
const gulp = require("gulp");
Project
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
export default class Project {
public get id(): string {
return this._id;
}
ProjectAPI
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
export default class ProjectAPI {
/**
* Create a project from a Zip file.
* @param file Zip file containing the source code. Can contain a config.xml file too.
* @returns {Promise<Project>} Promise of the project created.
APIURL
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
export default class APIURL {
public static get BASE(): string {
return APIURL._BASE;
}
Function downloadFile
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function downloadFile(url, outputPath) {
const dir = path.dirname(outputPath);
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
Function downloadProjectCompilation
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function downloadProjectCompilation(project, platform, outputDir) {
return waitForCompletion(project)
.then(() => {
if (project.compilations[platform]) {
if (project.compilations[platform].isReady()) {
Function request
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static async request(
options: RequestOptions,
popsiclePlugins: Middleware[] = [],
addCredentials: boolean = true,
): Promise<Response> {
- 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 getUnprocessed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static async getUnprocessed(signingKeyId: string): Promise<ISigningKeyData> {
const signingKeysData = await SigningKeyAPI.listUnprocessed();
for (const platform in signingKeysData) {
if (!signingKeysData.hasOwnProperty(platform)) {
continue;
- 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 get
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static async get(signingKeyId: string): Promise<SigningKey> {
const signingKeysData = await SigningKeyAPI.listUnprocessed();
for (const platform in signingKeysData) {
if (!signingKeysData.hasOwnProperty(platform)) {
continue;
- 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 isCompiling
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public isCompiling(): boolean {
for (const platform in this._compilations) {
if (!this._compilations.hasOwnProperty(platform)) {
continue;
}
- 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 tokenExchangeAuthorizationCode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public async tokenExchangeAuthorizationCode(pCode: string, state: string): Promise<IAccessToken> {
const parameters = {
client_id: this.clientId,
client_secret: this.clientSecret,
code: pCode,
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public constructor(data: IProjectData, platform: Platform) {
this._devapp = data.devapp && data.devapp.length > 0 && data.devapp.indexOf(platform as any) >= 0;
this._downloadLink = data.download ? data.download[platform] : null;
this._error = data.error ? data.error[platform] : null;
this._platform = platform;
- 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"