Showing 70 of 70 total issues
Function doWork
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const doWork = async (repo) => {
const readme = await getFile(gh, repo, "README.md")
if (!readme) {
log(repo, "Could not find a README")
return
Function processLogos
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var processLogos = function (entityLogos) {
for (var i = 0; i < entityLogos.length; i++) {
var entityLogo = entityLogos[i];
if (entityLogo) {
var url = entityLogo.getAttribute('data-src');
Function processLogos
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var processLogos = function (entityLogos) {
for (var i = 0; i < entityLogos.length; i++) {
var entityLogo = entityLogos[i];
if (entityLogo) {
var url = entityLogo.getAttribute('data-src');
Function processLogos
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var processLogos = function (entityLogos) {
for (var i = 0; i < entityLogos.length; i++) {
var entityLogo = entityLogos[i];
if (entityLogo) {
var url = entityLogo.getAttribute('data-src');
Function processLogos
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var processLogos = function (entityLogos) {
for (var i = 0; i < entityLogos.length; i++) {
var entityLogo = entityLogos[i];
if (entityLogo) {
var url = entityLogo.getAttribute('data-src');
Function init
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const init = async () => {
const contributorsList: Contributor[] = []
let page = '1'
// iterate over the pages of GitHub API
Function toggleItemMenu
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toggleItemMenu = function (e) {
var element = $(e.target),
parent = element[0].parentNode,
parentLink,
elementIconChild;
Function toggleItemMenu
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toggleItemMenu = function (e) {
var element = $(e.target),
parent = element[0].parentNode,
parentLink,
elementIconChild;
Function toggleItemMenu
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toggleItemMenu = function (e) {
var element = $(e.target),
parent = element[0].parentNode,
parentLink,
elementIconChild;
Function toggleItemMenu
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toggleItemMenu = function (e) {
var element = $(e.target),
parent = element[0].parentNode,
parentLink,
elementIconChild;
Function main
has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring. Open
Open
func main() {
flag.Parse()
cmd := exec.Command(*entrPath, *entrFlags)
cmd.Stdin = strings.NewReader(fmt.Sprintf("%s\n", *watchFile))
- 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 updateQueryString
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateQueryString(key, value) {
value = encodeURIComponent(value);
var url = window.location.href;
var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
Function updateQueryString
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateQueryString(key, value) {
value = encodeURIComponent(value);
var url = window.location.href;
var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
Function updateQueryString
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateQueryString(key, value) {
value = encodeURIComponent(value);
var url = window.location.href;
var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
Function getBranchDrift
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
new Promise((resolve, reject) => {
let output = ""
const delta = spawn("git", [
"rev-list",
"--left-right",
Function updateQueryString
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateQueryString(key, value) {
value = encodeURIComponent(value);
var url = window.location.href;
var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
Function getChangedFiles
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
new Promise((resolve, reject) => {
let changedBlob = ""
const changed = spawn("git", ["diff", "--name-status", "--relative", "origin/master"])
changed.stdout.on("data", (data) => {
changedBlob += data
Avoid deeply nested control flow statements. Open
Open
if (toggler) {
toggler.click();
}
Avoid deeply nested control flow statements. Open
Open
for(attr in value.attributes) {
if (DIRECTIVES[i].selector.indexOf(attr) !== -1) {
newNode.font = {
multi: 'html'
};
Avoid deeply nested control flow statements. Open
Open
if (toggler) {
toggler.click();
}