Socket
Socket
Sign inDemoInstall

cfpathcheck

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cfpathcheck - npm Package Compare versions

Comparing version 0.7.1 to 0.8.0

.codeclimate.yml

55

lib/cfpathcheck.js

@@ -16,4 +16,7 @@ /*global module, require */

/**
* Uses lodash isEqual to perform non-strict object comparison.
*
* @see http://stackoverflow.com/a/4587130/167987
* Uses lodash isEqual to perform non-strict object comparison
* @param {Object} obj - The object to search for.
* @param {Array} list - The array of objects to search.
*/

@@ -32,2 +35,10 @@ function containsObject(obj, list) {

/**
* Compares two arrays of cfml taglib prefixes to see if there are any mismatches.
*
* @param {Array} prefixArray1 - The first array of taglib prefixes.
* @param {Array} prefixArray2 - The second array of taglib prefixes.
* @param {string} message - The message to display in case of a violation.
* @param {string} severity - The violation severity.
*/
function comparePrefixArrays(prefixArray1, prefixArray2, message, severity) {

@@ -108,2 +119,7 @@

/**
* @param {string} str - The string to match.
* @param {RegExp} regex - The RegExp to use.
*/
function matchAll(str, regex) {

@@ -124,2 +140,7 @@ var res = [];

/**
* @param {string} filePath - The path of the file to check.
* Checks a file for missing paths.
*/
function checkFile(filePath) {

@@ -193,5 +214,9 @@ var templatePathViolations = [];

var includeMatches = matchAll(line, /template=\"([^"]+)\"/g);
// <cfinclude template="$path" />
var cfIncludeMatches = matchAll(line, /template=\"([^"]+)\"/g);
includeMatches.forEach(function (includeMatch) {
// include '$path'; (inside <cfscript>)
var includeMatches = matchAll(line, /\binclude\s['"]([^'"]+)['"]/g);
cfIncludeMatches.concat(includeMatches).forEach(function (includeMatch) {
// console.log(includeMatch);

@@ -218,3 +243,3 @@

column: includeMatch.index + 1,
message: 'cfinclude template path {1} not found'.replace('{1}', templatePath),
message: 'cfinclude/include template path {1} not found'.replace('{1}', templatePath),
severity: 'error'

@@ -249,9 +274,9 @@ });

check: function check(filePath, format) {
/**
* @param {string} filePath - The full path of the file to check.
*/
check: function check(filePath) {
var fileNames = [];
var violations = [];
format = format || 'dump'; // Not relevant in node...
// Resolve the path, if a relative path was passed in

@@ -304,2 +329,7 @@ if (!pathIsAbsolute(filePath)) {

/**
* @param {Array} violations - The violations array.
* @param {string} format - The output format to use.
*/
formatter: function formatter(violations, format) {

@@ -315,2 +345,7 @@ var output;

/**
* @param {string} output - The file contents to write.
* @param {string} outFile - The file to write to.
*/
writeFile: function writeFile(output, outFile) {

@@ -331,2 +366,6 @@ // Resolve the path if it's not absolute

/**
* @param {string|Array} output - The output to write.
*/
writeOutput: function writeOutput(output) {

@@ -333,0 +372,0 @@ if (output instanceof Array) {

15

package.json
{
"name": "cfpathcheck",
"description": "Check CFML files for correct paths in cfinclude/cfimport tags",
"version": "0.7.1",
"version": "0.8.0",
"homepage": "https://github.com/timbeadle/cfpathcheck",

@@ -17,2 +17,3 @@ "author": {

},
"license": "MIT",
"licenses": [

@@ -45,4 +46,4 @@ {

"crlf": "^1.1.0",
"glob": "^7.0.3",
"lodash": "^4.7.0",
"glob": "^7.0.5",
"lodash": "^4.15.0",
"log-symbols": "^1.0.2",

@@ -54,8 +55,10 @@ "minimist": "^1.2.0",

"devDependencies": {
"eslint-plugin-jsdoc": "^2.3.1",
"eslint-plugin-node": "^1.0.0",
"grunt": ">=0.4.5",
"grunt-release": "^0.13.0",
"gruntify-eslint": "^2.0.0",
"grunt": "^1.0.1",
"grunt-eslint": "^18.0.0",
"grunt-release-it": "^1.0.1",
"load-grunt-tasks": "^3.5.2",
"verb": "^0.8.10"
}
}

@@ -9,2 +9,4 @@ # cfpathcheck

[![Dependency Status](https://david-dm.org/timbeadle/cfpathcheck.svg)](https://david-dm.org/timbeadle/cfpathcheck)
[![devDependency Status](https://david-dm.org/timbeadle/cfpathcheck/dev-status.svg)](https://david-dm.org/timbeadle/cfpathcheck#info=devDependencies)
[![Code Climate](https://codeclimate.com/github/timbeadle/cfpathcheck/badges/gpa.svg)](https://codeclimate.com/github/timbeadle/cfpathcheck)

@@ -11,0 +13,0 @@ ## Installation

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc