Skip to content

Test gh app#4

Open
charlieblevins wants to merge 5 commits into
masterfrom
testGHApp
Open

Test gh app#4
charlieblevins wants to merge 5 commits into
masterfrom
testGHApp

Conversation

@charlieblevins

Copy link
Copy Markdown
Owner

No description provided.

Comment thread marker-api.js

function validate_marker_post (fields, file, res) {

console.log('validating photo');

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
console.log('validating photo');
console.log("validating photo");

Comment thread app.js
initPassport(passport);

// Allow index router to handle all incoming requests
var routes = require('./routes/index')(passport);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
var routes = require('./routes/index')(passport);
var routes = require("./routes/index")(passport);

Comment thread marker-api.js
if (tags) {

// Update marker data
Marker.findOne({'_id': marker_id}, function (err, marker) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
Marker.findOne({'_id': marker_id}, function (err, marker) {
Marker.findOne({"_id": marker_id}, function (err, marker) {

Comment thread marker-api.js
reads = [],
ids;

console.log('photo requests: ' + JSON.stringify(markers));

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
console.log('photo requests: ' + JSON.stringify(markers));
console.log("photo requests: " + JSON.stringify(markers));

Comment thread app.js
}

// respond with json
if (req.accepts('json')) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
if (req.accepts('json')) {
if (req.accepts("json")) {

Comment thread marker-api.js
_ = require("underscore"),
fs = require('fs'),
formidable = require('formidable'),
crypto = require('crypto'),

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
crypto = require('crypto'),
crypto = require("crypto"),

Comment thread marker-api.js
} else if (err.code === 11000) {
return res.status(422).json({message: 'Image file already exists. Duplicate images are not allowed.'});
} else {
return res.status(500).json({message: 'An internal error occurred'});

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
return res.status(500).json({message: 'An internal error occurred'});
return res.status(500).json({message: "An internal error occurred"});

Comment thread marker-api.js
reads.push(read.promise);
console.log('err code: ' + err.code);
if (err.code === 16755) {
return res.status(422).json({message: 'Latitude and longitude are not geographically valid.'});

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
return res.status(422).json({message: 'Latitude and longitude are not geographically valid.'});
return res.status(422).json({message: "Latitude and longitude are not geographically valid."});

Comment thread marker-api.js
// Loop over each size for this marker
sizes.forEach((size) => {
if (err) {
console.log('Error in saving marker: ' + err);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
console.log('Error in saving marker: ' + err);
console.log("Error in saving marker: " + err);

Comment thread marker-api.js
console.log('photo requests: ' + JSON.stringify(markers));

if (!markers) {
console.log('invalid data for get_photo_b64');

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
console.log('invalid data for get_photo_b64');
console.log("invalid data for get_photo_b64");

Comment thread marker-api.js

// Make sure user is authorized to see/edit this marker
if (!marker.user_id.equals(req.user._id)) {
return res.status(403).json({message: 'You are not authorized to view this marker'});

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
return res.status(403).json({message: 'You are not authorized to view this marker'});
return res.status(403).json({message: "You are not authorized to view this marker"});

Comment thread marker-api.js
if (page_index >= 0) {
query.skip(page_index * res_per_page);
} else {
console.log('invalid page value');

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
console.log('invalid page value');
console.log("invalid page value");

Comment thread marker-api.js
['', '_md', '_sm'].forEach((suffix) => {

const photo = marker._id.toString() + suffix + '.jpg';
const existing_path = __dirname + '/public/photos/' + photo;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
const existing_path = __dirname + '/public/photos/' + photo;
const existing_path = __dirname + "/public/photos/" + photo;

Comment thread marker-api.js
}

function handle_marker_data_failure () {
console.log('marker data failure');

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Strings must use doublequote.

Suggested change
console.log('marker data failure');
console.log("marker data failure");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant