Showing 192 of 192 total issues
Function exports
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function () {
this.Given(/^a URL representing a remote Git repo "([^"]*)"$/, function (repoUrl) {
this.repoUrl = repoUrl;
});
- Create a ticketCreate a ticket
Function exports
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function() {
// Shared variables
var featureText;
var features;
- Create a ticketCreate a ticket
Function checkResultsFromList
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function checkResultsFromList(array, scenario) {
if (array && array.length > 0) {
var passes ='';
var scenarioName= scenario.name;
if(scenario.type === 'ScenarioOutline' ) {
- Read upRead up
- Create a ticketCreate a ticket
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
getProjectData(projectData, ref)
.then(function (_projectData) {
projectData = _projectData;
var filePathToFileObject = processFiles.getFilePathToFileObject(appConfig.projectRoute, projectData, getFileContent);
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 88.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
getProjectData(projectData, ref)
.then(function (_projectData) {
projectData = _projectData;
var filePathToFileObject = processFiles.getFilePathToFileObject(appConfig.projectRoute, projectData, getFileContent);
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 88.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function _processViews
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _processViews(projectViews) {
var viewNames;
// Valid undefined argument.
if (projectViews === undefined) {
- Create a ticketCreate a ticket
Function switchToDemoBranch
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function switchToDemoBranch(callback) {
var world = this;
var burgerMenuId = 'expand-collapse-repository-controls';
var repositoryCongtrolsId = 'repository-controls';
var projectShaElId = 'project-commit';
- Create a ticketCreate a ticket
Function exports
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function() {
// Shared variables
var featureText;
var features;
- Read upRead up
- Create a ticketCreate a ticket
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 compareJobsAndFeatures
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function compareJobsAndFeatures(array, scenarioName,directFeature) {
if (array && array.length > 0) {
var passes ='';
for( var i = 0; i < array.length ; i++) {
//If we check direct equals then we miss out some in scenario outline that end in digits, so needs changing
- Read upRead up
- Create a ticketCreate a ticket
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 getRender
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getRender(res, appConfig, renderOptions) {
return function render(projectData) {
var renderingData = {};
// The tags object associated with this project.
- Create a ticketCreate a ticket
Function render
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function render(projectData) {
var renderingData = {};
// The tags object associated with this project.
var projectTags = {};
- Create a ticketCreate a ticket
Function getRender
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function getRender(res, appConfig, renderOptions) {
return function render(projectData) {
var renderingData = {};
// The tags object associated with this project.
- Read upRead up
- Create a ticketCreate a ticket
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 seleniumHooks
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function seleniumHooks() {
// Lets give browser a minute to start up
this.Before({ tags: ['@ui-automation'], timeout: 60 * 1000}, function(scenario, callback) {
var world = this;
var timeoutManager;
- Create a ticketCreate a ticket
Function applyProjectView
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function applyProjectView(projectData, renderingData) {
var currentProjectViewName = renderingData.currentProjectViewName;
var projectView = {};
var viewNames = [];
- Read upRead up
- Create a ticketCreate a ticket
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 expandCollapseDetails
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function expandCollapseDetails() {
var featureTitleEl = window.document.getElementById('feature-title');
var tagsButtonEl = window.document.getElementById('expand-collapse-tags');
var featureDetailsEls = window.document.getElementsByClassName('feature-details');
var scenarioDetailsEls = window.document.getElementsByClassName('scenario-details');
- Create a ticketCreate a ticket
Function applyProjectView
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyProjectView(projectData, renderingData) {
var currentProjectViewName = renderingData.currentProjectViewName;
var projectView = {};
var viewNames = [];
- Create a ticketCreate a ticket
Function filterFeaturesAndScenarios
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function filterFeaturesAndScenarios(projectData, projectTags, currentTagName) {
// Count the project tags and mark the current
// tag of interest if there is one.
let ret = countProjectTags(projectData, projectTags, currentTagName);
- Create a ticketCreate a ticket
Function update
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update(projectData) {
var repository;
var defaultBranch;
var defaultRemoteBranch;
- Create a ticketCreate a ticket
Function getProjectData
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getProjectData(projectData, targetBranchName) {
var currentRef;
var repository;
var remoteUrl;
var headCommit;
- Create a ticketCreate a ticket
Function getCustomCapabilitiesFromEnvironment
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getCustomCapabilitiesFromEnvironment(webdriver) {
var saucelabsProperties = {};
var browserKey = webdriver.Capability.BROWSER_NAME;
var platformKey = webdriver.Capability.PLATFORM_NAME;
- Create a ticketCreate a ticket