Showing 83 of 394 total issues
File site.js
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const { Op } = require('sequelize');
const { toInt } = require('../utils');
const {
branchRegex, isEmptyOrUrl, isValidSubdomain,
} = require('../utils/validators');
Function sites
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function sites(state = initialState, action) {
switch (action.type) {
case HTTP_ERROR:
return { ...state, isLoading: false };
Function exports
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (sequelize, DataTypes) => {
const UAAIdentity = sequelize.define('UAAIdentity', {
uaaId: {
type: DataTypes.STRING,
allowNull: false,
Function setValue
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setValue(newValue) {
let oldValue = value;
let str; let
len;
Function up
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.up = async (db) => {
await db.createTable(TABLE_NAME, TABLE_SCHEMA);
await db.addIndex(TABLE_NAME, TABLE_INDEX_NAME, ["siteId", "branch"], true);
const { rows: sites } = await db.runSql(SELECT_SITE_CONFIGS);
Function expand
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function expand(recursive, silent) {
let keys;
if (type == 'object') {
keys = Object.keys(value);
Function createBuildForWebhookRequest
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const createBuildForWebhookRequest = async (payload, site) => {
const { login } = payload.sender;
const { pushed_at: pushedAt } = payload.repository;
const username = login.toLowerCase();
Function SitePublishedFilesTable
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SitePublishedFilesTable() {
const { id, name } = useParams();
const publishedFiles = useSelector(state => state.publishedFiles);
const [currentPage, setCurrentPage] = useState(0);
Function provision
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function provision(domain, dnsResults) {
if (!domain.isPending()) {
throw new Error(`Only '${States.Pending}' domains can be provisioned.`);
}
Function verifyUAAUser
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function verifyUAAUser(accessToken, refreshToken, profile, uaaGroups) {
const { user_id: uaaId, email } = profile;
const client = new UAAClient();
const isVerified = await client.verifyUserGroup(uaaId, uaaGroups);
Function auditSite
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const auditSite = (auditor, site, userIndex = 0) => {
let collaborators;
const user = site.Users[userIndex];
if (!user) { return Promise.resolve(); }
Function editFieldStop
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function editFieldStop(field) {
const element = dom[field];
if (field == 'name') {
if (!edittingName) {
Function createExternalDomain
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async createExternalDomain(params) {
const {
domains,
name,
origin,
Function destroy
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async destroy(req, res) {
const { params, user } = req;
const { id, site_id: siteId } = params;
const site = await Site.forUser(user)
Function createExternalDomain
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async createExternalDomain(params) {
const {
domains,
name,
origin,
Function migrated
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const migrated = sites.map(async (site) => {
const {
id: siteId,
owner,
repository,
Function archiveBuildLogsDaily
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function archiveBuildLogsDaily(job) {
const logger = createJobLogger(job);
// our daily job uses a three day window to check for previous logs in case of failure
const startDate = moment().subtract(3, 'days').startOf('day');
const endDate = startDate.clone().add(3, 'days');
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(baseURL) {
/**
* @type {axios.AxiosInstance}
*/
this.client = axios.create({
Function rebuild
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async rebuild(req, res) {
const requestBuild = await Build.findOne({
where: {
id: req.body.buildId,
site: req.body.siteId,
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(baseURL) {
/**
* @type {axios.AxiosInstance}
*/
this.client = axios.create({