Showing 151 of 336 total issues
File Select.js
has 1252 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @flow
const React = require("react");
import type {Context} from "../types.js";
Function exports
has 430 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(app) {
const ImageImport = models("ImageImport");
const RecordImport = models("RecordImport");
const {auth, canEdit} = require("./shared/auth");
Function exports
has 323 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(app) {
const {auth, isAdmin} = require("./shared/auth");
return {
admin(req, res) {
File Record.js
has 695 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @flow
/* global PhotoSwipe, PhotoSwipeUI_Default */
const React = require("react");
File Record.js
has 655 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const async = require("async");
const jdp = require("jsondiffpatch").create({
objectHash: obj => obj._id,
});
File SourceAdmin.js
has 581 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @flow
const React = require("react");
import type {Context} from "./types.js";
Function exports
has 223 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(app: express$Application) {
const Image = models("Image");
const {auth, canEdit} = require("./shared/auth");
File Image.js
has 537 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const fs = require("fs");
const path = require("path");
const farmhash = require("farmhash");
const imageinfo = require("imageinfo");
File EditRecord.js
has 525 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @flow
const React = require("react");
const FixedStringEdit = require("./types/edit/FixedString.js");
Function lintData
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
Open
lintData(data, i18n, optionalSchema) {
const schema = optionalSchema || recordModel(this.getType()).schema;
const cleaned = {};
const warnings = [];
- 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 exports
has 208 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(app: express$Application) {
const Image = models("Image");
const Source = models("Source");
const {auth, canEdit} = require("./shared/auth");
Function clusterImages
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
Open
const clusterImages = (records: Array<RecordType>) => {
const sourceRecord = records[0];
const rows = [
{
record: sourceRecord,
- 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
File source-admin.js
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const fs = require("fs");
const async = require("async");
const formidable = require("formidable");
const jdp = require("jsondiffpatch");
File admin.js
has 424 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const fs = require("fs");
const path = require("path");
const {Readable} = require("stream");
const async = require("async");
Function exports
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = app => {
const Upload = models("Upload");
const UploadImage = models("UploadImage");
const Source = models("Source");
Function lintData
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lintData(data, i18n, optionalSchema) {
const schema = optionalSchema || recordModel(this.getType()).schema;
const cleaned = {};
const warnings = [];
Function exports
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(app: express$Application) {
const Source = models("Source");
const show = (
{i18n, originalUrl, params, query, user}: express$Request,
Function create
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const create = (req: express$Request, res, next) => {
const {
params: {type},
i18n,
lang,
Function edit
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const edit = (req: express$Request, res, next) => {
const {
params: {type, recordName, source},
i18n,
lang,
File Search.js
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @flow
const React = require("react");
const SearchForm = require("./SearchForm.js");