publiclab/image-sequencer

View on GitHub

Showing 206 of 267 total issues

Function Channel has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function Channel(options, UI) {

  var output;

  function draw(input, callback, progressObj) {
Severity: Minor
Found in src/modules/Histogram/Module.js - About 4 hrs to fix

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 LoadImage has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function LoadImage(ref, name, src, main_callback) {
  function makeImage(datauri) {
    var image = {
      src: datauri,
      format: datauri.split(':')[1].split(';')[0].split('/')[1]
Severity: Major
Found in src/ui/LoadImage.js - About 3 hrs to fix

Function onload has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

window.onload = function () {
  sequencer = ImageSequencer(); // Set the global sequencer variable
  
  options = {
    sortField: 'text',
Severity: Minor
Found in examples/demo.js - About 3 hrs to fix

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 extraManipulation has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function extraManipulation(pixels) {
      let [w, h] = pixels.shape;
      let newPixels = require('ndarray')(new Uint8Array(4 * (w + Math.abs(options.X_value)) * (h + Math.abs(options.Y_value))).fill(0), [(w + Math.abs(options.X_value)), (h + Math.abs(options.Y_value)), 4]);
      let iMax = w,
        jMax = h;
Severity: Major
Found in src/modules/Shadow/Module.js - About 3 hrs to fix

Function setInputStepInit has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function setInputStepInit() {

  return function setInputStep(options) {

    var dropzone = $(options.dropZoneSelector);
Severity: Major
Found in src/ui/SetInputStep.js - About 3 hrs to fix

Function setInputStep has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  return function setInputStep(options) {

    var dropzone = $(options.dropZoneSelector);
    var fileInput = $(options.fileInputSelector);
    var takePhoto = $(options.takePhotoSelector);
Severity: Major
Found in src/ui/SetInputStep.js - About 3 hrs to fix

Function Blend has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function Blend(options, UI, util) {

  var defaults = require('./../../util/getDefaults.js')(require('./info.json'));

  options.func = options.blend || defaults.blend;
Severity: Major
Found in src/modules/Blend/Module.js - About 3 hrs to fix

Function exports has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(grunt) {
  grunt.loadNpmTasks('grunt-browserify');
  grunt.loadNpmTasks('grunt-contrib-uglify-es');
  grunt.loadNpmTasks('grunt-browser-sync');
  grunt.loadNpmTasks('grunt-text-replace');
Severity: Major
Found in Gruntfile.js - About 3 hrs to fix

Function ColorHalftone has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function ColorHalftone(options, UI) {

  var defaults = require('./../../util/getDefaults.js')(require('./info.json'));

  var output;
Severity: Major
Found in src/modules/ColorHalftone/Module.js - About 3 hrs to fix

Function setInputStepInit has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

function setInputStepInit() {

  return function setInputStep(options) {

    var dropzone = $(options.dropZoneSelector);
Severity: Minor
Found in src/ui/SetInputStep.js - About 3 hrs to fix

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 Gradient has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function Gradient(options, UI) {

  var defaults = require('./../../util/getDefaults.js')(require('./info.json'));
  options.gradientType = options.gradientType || defaults.gradientType;

Severity: Minor
Found in src/modules/Gradient/Module.js - About 3 hrs to fix

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 draw has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function draw(input, callback, progressObj) {

    progressObj.stop(true);
    progressObj.overrideFlag = true;

Severity: Major
Found in src/modules/Blend/Module.js - About 3 hrs to fix

Function Dynamic has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function Dynamic(options, UI, util) {

  const defaults = require('./../../util/getDefaults.js')(require('./info.json'));
  options.x = options.x || defaults.x;
  options.y = options.y || defaults.y;
Severity: Major
Found in src/modules/Overlay/Module.js - About 3 hrs to fix

Function Dynamic has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function Dynamic(options, UI) {
  var defaults = require('./../../util/getDefaults.js')(require('./info.json'));
  var output;

  // This function is called on every draw.
Severity: Major
Found in src/modules/Dynamic/Module.js - About 3 hrs to fix

Function MinifyImage has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function MinifyImage(options, UI) {
  var output;
  if (!options.inBrowser) {
    base64Img = require('base64-img');
    imagemin = require('imagemin');
Severity: Major
Found in src/modules/MinifyImage/Module.js - About 2 hrs to fix

Function ColorTemperature has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function ColorTemperature(options, UI) {
  
  const pixelSetter = require('../../util/pixelSetter.js');
  var defaults = require('./../../util/getDefaults.js')(require('./info.json'));

Severity: Minor
Found in src/modules/ColorTemperature/Module.js - About 2 hrs to fix

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 DefaultHtmlSequencerUi has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function DefaultHtmlSequencerUi(_sequencer, options) {

  options = options || {};
  var addStepSel = options.addStepSel = options.addStepSel || '#addStep';
  var removeStepSel = options.removeStepSel = options.removeStepSel || 'button.remove';
Severity: Major
Found in examples/lib/defaultHtmlSequencerUi.js - About 2 hrs to fix

Function formatInput has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function formatInput(args, format, images) {
  var json_q = {};
  var format_i = format;
  if (format == '+')
    format = ['string_a', 'o_object'];
Severity: Major
Found in src/FormatInput.js - About 2 hrs to fix

Function Dither has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function Dither(pixels, type) {
  type = type;
  let bayerThresholdMap = [
    [15, 135, 45, 165],
    [195, 75, 225, 105],
Severity: Minor
Found in src/modules/Dither/Dither.js - About 2 hrs to fix

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 setupCache has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var setupCache = function() {
  let newWorker; // When sw.js is changed, this is the new service worker generated.
  
  // Toggle a CSS class to display a popup prompting the user to fetch a new version.
  function showUpdateModal() {
Severity: Major
Found in examples/lib/cache.js - About 2 hrs to fix
Severity
Category
Status
Source
Language