Showing 14 of 28 total issues
Function getInfo
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getInfo: function() {
var env = process.env;
if (env.TRAVIS) {
return {
Function getInfo
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
getInfo: function() {
var env = process.env;
if (env.TRAVIS) {
return {
- 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 sourceFiles
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Formatter.prototype.sourceFiles = function(data) {
var source_files = [];
var self = this;
data.forEach(function(elem, index) {
var content;
Function exports
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(data, cb) {
var memo = {};
var parsedData = [];
var lines = data.split('\n');
Function format
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Formatter.prototype.format = function(coverageData, callback) {
var self = this;
self.parse(coverageData, function(parseError, data) {
if (parseError) {
Function postJson
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var postJson = function(data, opts) {
opts = opts || {};
options.rejectUnauthorized = !opts.skip_certificate;
Avoid too many return
statements within this function. Open
Open
return {
name: "gitlab-ci",
build_identifier: env.CI_BUILD_ID,
branch: env.CI_BUILD_REF_NAME,
commit_sha: env.CI_BUILD_REF
Avoid too many return
statements within this function. Open
Open
return {};
Avoid too many return
statements within this function. Open
Open
return {
name: "tddium",
build_identifier: env.TDDIUM_SESSION_ID,
worker_id: env.TDDIUM_TID
};
Avoid too many return
statements within this function. Open
Open
return {
name: "buildkite",
build_identifier: env.BUILDKITE_BUILD_ID,
build_url: env.BUILDKITE_BUILD_URL,
branch: env.BUILDKITE_BRANCH,
Avoid too many return
statements within this function. Open
Open
return {
name: "wercker",
build_identifier: env.WERCKER_BUILD_ID,
build_url: env.WERCKER_BUILD_URL,
branch: env.WERCKER_GIT_BRANCH,
Avoid too many return
statements within this function. Open
Open
return {
name: "codeship",
build_identifier: env.CI_BUILD_NUMBER,
build_url: env.CI_BUILD_URL,
branch: env.CI_BRANCH,
Avoid too many return
statements within this function. Open
Open
return {
name: "appveyor",
build_identifier: env.APPVEYOR_BUILD_NUMBER,
branch: env.APPVEYOR_REPO_BRANCH,
commit_sha: env.APPVEYOR_REPO_COMMIT,
Function committedAt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
committedAt: function(cb) {
childProcess.exec("git log -1 --pretty=format:%ct", function (error, stdout, stderr) {
var result = null;
var timestamp = null;
if (stdout) {
- 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"