publiclab/image-sequencer

View on GitHub

Showing 206 of 267 total issues

Function mapHtmlTypes has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function mapHtmlTypes(inputInfo){
  var htmlType;
  switch(inputInfo.type.toLowerCase()){
  case 'integer':
    htmlType = inputInfo.min != undefined ? 'range' : 'number';
Severity: Minor
Found in examples/lib/mapHtmltypes.js - About 1 hr to fix

Function runInBrowserContext has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function runInBrowserContext(input, callback, step, options) {

  // to ignore this from getting browserified
  const puppeteer = eval('require')('puppeteer');

Severity: Minor
Found in src/modules/_nomodule/gl-context.js - About 1 hr to fix

Function replaceImage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function replaceImage (img, steps) {
    var url = img.src;
    // refactor to filetypeFromUrl()
    var ext = url.split('?')[0].split('.').pop();

Severity: Minor
Found in src/ReplaceImage.js - About 1 hr to fix

Function PaintBucket has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

  var output;

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

Function onCallback has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      internalSequencer.run(function onCallback(internalOutput) {

        getPixels(internalOutput, function(err, pixels) {
          options.firstImagePixels = pixels;

Severity: Minor
Found in src/modules/Mask/Module.js - About 1 hr to fix

Function GridOverlay has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

  var output;

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

Function draw has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function draw(input, callback, progressObj) {

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

Severity: Minor
Found in src/modules/WhiteBalance/Module.js - About 1 hr to fix

Function colorHalftone has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var colorHalftone = function colorHalftone(id, options, download) {

    // try to create a WebGL canvas (will fail if WebGL isn't supported)
    try {
      var canvas = fx.canvas(1500, 1500);
Severity: Minor
Found in src/modules/ColorHalftone/Module.js - About 1 hr to fix

Function extraManipulation has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function extraManipulation(pixels) {

      let temp = parseInt(options.temperature);
      temp /= 100;

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

Function setup has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function setup() {
    let x = 0,
      y = 0;

    // display original uncropped input image on initial setup
Severity: Minor
Found in src/modules/Crop/Ui.js - About 1 hr to fix

Function draw has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function draw(input, callback, progressObj) {

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

Severity: Minor
Found in src/modules/Ndvi/Module.js - About 1 hr to fix

Function Average has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

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

  var output;

  options.step.metadata = options.step.metadata || {};
Severity: Minor
Found in src/modules/Average/Module.js - About 1 hr 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 Channel has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

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

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

  options.channel = options.channel || defaults.channel;
Severity: Minor
Found in src/modules/Channel/Module.js - About 1 hr 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 canvasResize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

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

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

Severity: Minor
Found in src/modules/CanvasResize/Module.js - About 1 hr 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 generatePreview has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function generatePreview(previewStepName, customValues, path, DomNode) {
  var previewSequencer = ImageSequencer();
  function insertPreview(src) {
    var img = document.createElement('img');
    img.classList.add('img-thumbnail');
Severity: Minor
Found in examples/lib/insertPreview.js - About 1 hr to fix

Function draw has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function draw(input, callback, progressObj) {

    options.saturation = options.saturation || defaults.saturation;

    progressObj.stop(true);
Severity: Minor
Found in src/modules/Saturation/Module.js - About 1 hr to fix

Function draw has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function draw(input, callback) {

    var step = this;

    options.angle = options.angle || defaults.angle;
Severity: Minor
Found in src/modules/ColorHalftone/Module.js - About 1 hr to fix

Function Invert has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Invert(options, UI) {

  var output;

  // The function which is called on every draw.
Severity: Minor
Found in src/modules/Invert/Module.js - About 1 hr to fix

Function draw has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function draw(input, callback, progressObj) {

    var color = options.color || defaults.color;
    color = color.substring(color.indexOf('(') + 1, color.length - 1); // extract only the values from rgba(_,_,_,_)
    color = color.split(',');
Severity: Minor
Found in src/modules/Tint/Module.js - About 1 hr to fix

Function draw has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function draw(input, callback, progressObj) {

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

Severity: Minor
Found in src/modules/Threshold/Module.js - About 1 hr to fix
Severity
Category
Status
Source
Language